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

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

Issue 2741033004: Infer types of instance methods before any other inference. (Closed)
Patch Set: Created 3 years, 9 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/lib/src/task/strong_mode.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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 // are treated as independent methods. 942 // are treated as independent methods.
943 expect(setterB.parameters[0].type, setterA.parameters[0].type); 943 expect(setterB.parameters[0].type, setterA.parameters[0].type);
944 944
945 // Note that B's synthetic field type will be String. This matches what 945 // Note that B's synthetic field type will be String. This matches what
946 // resolver would do if we explicitly typed the parameter as 'String' 946 // resolver would do if we explicitly typed the parameter as 'String'
947 expect(fieldB.type, setterB.parameters[0].type); 947 expect(fieldB.type, setterB.parameters[0].type);
948 } 948 }
949 949
950 InstanceMemberInferrer _runInferrer(CompilationUnitElement unit) { 950 InstanceMemberInferrer _runInferrer(CompilationUnitElement unit) {
951 InstanceMemberInferrer inferrer = createInferrer(unit.library); 951 InstanceMemberInferrer inferrer = createInferrer(unit.library);
952 inferrer.inferInstanceMethods(unit);
952 inferrer.inferCompilationUnit(unit); 953 inferrer.inferCompilationUnit(unit);
953 return inferrer; 954 return inferrer;
954 } 955 }
955 } 956 }
956 957
957 @reflectiveTest 958 @reflectiveTest
958 class SetFieldTypeTest extends ResolverTestCase { 959 class SetFieldTypeTest extends ResolverTestCase {
959 test_setter_withoutParameter() async { 960 test_setter_withoutParameter() async {
960 Source source = addSource(''' 961 Source source = addSource('''
961 var x = 0; 962 var x = 0;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 } 1032 }
1032 } 1033 }
1033 } 1034 }
1034 '''); 1035 ''');
1035 var analysisResult = await computeAnalysisResult(source); 1036 var analysisResult = await computeAnalysisResult(source);
1036 VariableGatherer gatherer = new VariableGatherer(filter); 1037 VariableGatherer gatherer = new VariableGatherer(filter);
1037 analysisResult.unit.accept(gatherer); 1038 analysisResult.unit.accept(gatherer);
1038 return gatherer.results; 1039 return gatherer.results;
1039 } 1040 }
1040 } 1041 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698