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 13 matching lines...) Expand all Loading... |
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 var inheritanceManager = new InheritanceManager(library); |
33 return new InstanceMemberInferrer( | 33 return new InstanceMemberInferrer( |
34 context.typeProvider, (_) => inheritanceManager, new Set(), | 34 context.typeProvider, (_) => inheritanceManager, |
35 typeSystem: context.typeSystem); | 35 typeSystem: context.typeSystem); |
36 } | 36 } |
37 | 37 |
38 /** | 38 /** |
39 * 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 |
40 * the source. | 40 * the source. |
41 */ | 41 */ |
42 Future<CompilationUnitElement> resolve(String content) async { | 42 Future<CompilationUnitElement> resolve(String content) async { |
43 Source source = addNamedSource('/test.dart', content); | 43 Source source = addNamedSource('/test.dart', content); |
44 if (enableNewAnalysisDriver) { | 44 if (enableNewAnalysisDriver) { |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 } | 489 } |
490 } | 490 } |
491 } | 491 } |
492 '''); | 492 '''); |
493 var analysisResult = await computeAnalysisResult(source); | 493 var analysisResult = await computeAnalysisResult(source); |
494 VariableGatherer gatherer = new VariableGatherer(filter); | 494 VariableGatherer gatherer = new VariableGatherer(filter); |
495 analysisResult.unit.accept(gatherer); | 495 analysisResult.unit.accept(gatherer); |
496 return gatherer.results; | 496 return gatherer.results; |
497 } | 497 } |
498 } | 498 } |
OLD | NEW |