| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library analyzer.test.src.summary.resynthesize_ast_test; | 5 library analyzer.test.src.summary.resynthesize_ast_test; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
| 9 import 'package:analyzer/src/dart/element/element.dart'; | 9 import 'package:analyzer/src/dart/element/element.dart'; |
| 10 import 'package:analyzer/src/generated/engine.dart' | 10 import 'package:analyzer/src/generated/engine.dart' |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 Source source = addSource('/main.dart', content); | 59 Source source = addSource('/main.dart', content); |
| 60 SummaryResynthesizer resynthesizer = _encodeLibrary(source); | 60 SummaryResynthesizer resynthesizer = _encodeLibrary(source); |
| 61 LibraryElementImpl resynthesized = _checkSource(resynthesizer, source); | 61 LibraryElementImpl resynthesized = _checkSource(resynthesizer, source); |
| 62 for (Source otherSource in otherLibrarySources) { | 62 for (Source otherSource in otherLibrarySources) { |
| 63 _checkSource(resynthesizer, otherSource); | 63 _checkSource(resynthesizer, otherSource); |
| 64 } | 64 } |
| 65 return resynthesized.definingCompilationUnit; | 65 return resynthesized.definingCompilationUnit; |
| 66 } | 66 } |
| 67 | 67 |
| 68 @override | 68 @override |
| 69 void compareLocalVariableElementLists(ExecutableElement resynthesized, | 69 void compareLocalElementsOfExecutable(ExecutableElement resynthesized, |
| 70 ExecutableElement original, String desc) { | 70 ExecutableElement original, String desc) { |
| 71 // We don't resynthesize local elements during link. | 71 // We don't resynthesize local elements during link. |
| 72 // So, we should not compare them. | 72 // So, we should not compare them. |
| 73 } | 73 } |
| 74 | 74 |
| 75 @override | 75 @override |
| 76 DartSdk createDartSdk() => AbstractContextTest.SHARED_STRONG_MOCK_SDK; | 76 DartSdk createDartSdk() => AbstractContextTest.SHARED_STRONG_MOCK_SDK; |
| 77 | 77 |
| 78 @override | 78 @override |
| 79 AnalysisOptionsImpl createOptions() => new AnalysisOptionsImpl() | 79 AnalysisOptionsImpl createOptions() => new AnalysisOptionsImpl() |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 @override | 149 @override |
| 150 @failingTest | 150 @failingTest |
| 151 void test_blockBodiedLambdas_syncStar_topLevel() { | 151 void test_blockBodiedLambdas_syncStar_topLevel() { |
| 152 super.test_blockBodiedLambdas_syncStar_topLevel(); | 152 super.test_blockBodiedLambdas_syncStar_topLevel(); |
| 153 } | 153 } |
| 154 | 154 |
| 155 @override | 155 @override |
| 156 @failingTest | 156 @failingTest |
| 157 void test_downwardsInferenceOnFunctionOfTUsingTheT() { | |
| 158 super.test_downwardsInferenceOnFunctionOfTUsingTheT(); | |
| 159 } | |
| 160 | |
| 161 @override | |
| 162 @failingTest | |
| 163 void test_downwardsInferenceOnGenericFunctionExpressions() { | |
| 164 super.test_downwardsInferenceOnGenericFunctionExpressions(); | |
| 165 } | |
| 166 | |
| 167 @override | |
| 168 @failingTest | |
| 169 void test_genericMethods_inferJSBuiltin() { | 157 void test_genericMethods_inferJSBuiltin() { |
| 170 super.test_genericMethods_inferJSBuiltin(); | 158 super.test_genericMethods_inferJSBuiltin(); |
| 171 } | 159 } |
| 172 | 160 |
| 173 void test_infer_extractIndex_custom() { | 161 void test_infer_extractIndex_custom() { |
| 174 var unit = checkFile(''' | 162 var unit = checkFile(''' |
| 175 class A { | 163 class A { |
| 176 String operator [](_) => null; | 164 String operator [](_) => null; |
| 177 } | 165 } |
| 178 var a = new A(); | 166 var a = new A(); |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 void test_invokeMethod_notGeneric_notGenericClass() { | 560 void test_invokeMethod_notGeneric_notGenericClass() { |
| 573 var unit = checkFile(r''' | 561 var unit = checkFile(r''' |
| 574 class C { | 562 class C { |
| 575 int m(int a, {String b, int c}) => null; | 563 int m(int a, {String b, int c}) => null; |
| 576 } | 564 } |
| 577 var v = new C().m(1, b: 'bbb', c: 2.0); | 565 var v = new C().m(1, b: 'bbb', c: 2.0); |
| 578 '''); | 566 '''); |
| 579 expect(unit.topLevelVariables[0].type.toString(), 'int'); | 567 expect(unit.topLevelVariables[0].type.toString(), 'int'); |
| 580 } | 568 } |
| 581 | 569 |
| 582 @override | |
| 583 @failingTest | |
| 584 void test_nullLiteralShouldNotInferAsBottom() { | |
| 585 super.test_nullLiteralShouldNotInferAsBottom(); | |
| 586 } | |
| 587 | |
| 588 LibraryElementImpl _checkSource( | 570 LibraryElementImpl _checkSource( |
| 589 SummaryResynthesizer resynthesizer, Source source) { | 571 SummaryResynthesizer resynthesizer, Source source) { |
| 590 LibraryElementImpl resynthesized = | 572 LibraryElementImpl resynthesized = |
| 591 resynthesizer.getLibraryElement(source.uri.toString()); | 573 resynthesizer.getLibraryElement(source.uri.toString()); |
| 592 LibraryElementImpl original = context.computeLibraryElement(source); | 574 LibraryElementImpl original = context.computeLibraryElement(source); |
| 593 checkLibraryElements(original, resynthesized); | 575 checkLibraryElements(original, resynthesized); |
| 594 return resynthesized; | 576 return resynthesized; |
| 595 } | 577 } |
| 596 } | 578 } |
| 597 | 579 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 } | 727 } |
| 746 | 728 |
| 747 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); | 729 UnlinkedUnit definingUnit = _getUnlinkedUnit(librarySource); |
| 748 LinkedLibraryBuilder linkedLibrary = | 730 LinkedLibraryBuilder linkedLibrary = |
| 749 prelink(definingUnit, getPart, getImport); | 731 prelink(definingUnit, getPart, getImport); |
| 750 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { | 732 linkedLibrary.dependencies.skip(1).forEach((LinkedDependency d) { |
| 751 _serializeLibrary(resolveRelativeUri(d.uri)); | 733 _serializeLibrary(resolveRelativeUri(d.uri)); |
| 752 }); | 734 }); |
| 753 } | 735 } |
| 754 } | 736 } |
| OLD | NEW |