Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: pkg/analyzer/test/src/task/strong_mode_test.dart

Issue 2832893002: Issue 29398. Infer instance members using InheritanceManager of the ClassElement. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/src/summary/top_level_inference_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/src/summary/top_level_inference_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698