| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.task.strong_mode_test; | 5 library analyzer.test.src.task.strong_mode_test; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 defineReflectiveTests(InstanceMemberInferrerTest); | 22 defineReflectiveTests(InstanceMemberInferrerTest); |
| 23 defineReflectiveTests(SetFieldTypeTest); | 23 defineReflectiveTests(SetFieldTypeTest); |
| 24 defineReflectiveTests(VariableGathererTest); | 24 defineReflectiveTests(VariableGathererTest); |
| 25 }); | 25 }); |
| 26 } | 26 } |
| 27 | 27 |
| 28 @reflectiveTest | 28 @reflectiveTest |
| 29 class InstanceMemberInferrerTest extends ResolverTestCase { | 29 class InstanceMemberInferrerTest extends ResolverTestCase { |
| 30 InstanceMemberInferrer createInferrer(LibraryElement library) { | 30 InstanceMemberInferrer createInferrer(LibraryElement library) { |
| 31 AnalysisContext context = library.context; | 31 AnalysisContext context = library.context; |
| 32 var inheritanceManager = new InheritanceManager(library); |
| 32 return new InstanceMemberInferrer( | 33 return new InstanceMemberInferrer( |
| 33 context.typeProvider, new InheritanceManager(library), new Set(), | 34 context.typeProvider, (_) => inheritanceManager, new Set(), |
| 34 typeSystem: context.typeSystem); | 35 typeSystem: context.typeSystem); |
| 35 } | 36 } |
| 36 | 37 |
| 37 /** | 38 /** |
| 38 * Add a source with the given [content] and return the result of resolving | 39 * Add a source with the given [content] and return the result of resolving |
| 39 * the source. | 40 * the source. |
| 40 */ | 41 */ |
| 41 Future<CompilationUnitElement> resolve(String content) async { | 42 Future<CompilationUnitElement> resolve(String content) async { |
| 42 Source source = addNamedSource('/test.dart', content); | 43 Source source = addNamedSource('/test.dart', content); |
| 43 if (enableNewAnalysisDriver) { | 44 if (enableNewAnalysisDriver) { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 493 } |
| 493 } | 494 } |
| 494 } | 495 } |
| 495 '''); | 496 '''); |
| 496 var analysisResult = await computeAnalysisResult(source); | 497 var analysisResult = await computeAnalysisResult(source); |
| 497 VariableGatherer gatherer = new VariableGatherer(filter); | 498 VariableGatherer gatherer = new VariableGatherer(filter); |
| 498 analysisResult.unit.accept(gatherer); | 499 analysisResult.unit.accept(gatherer); |
| 499 return gatherer.results; | 500 return gatherer.results; |
| 500 } | 501 } |
| 501 } | 502 } |
| OLD | NEW |