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

Unified Diff: pkg/analyzer/test/src/summary/linker_test.dart

Issue 2754423002: Fail inference when an instance field is referenced. (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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/src/summary/linker_test.dart
diff --git a/pkg/analyzer/test/src/summary/linker_test.dart b/pkg/analyzer/test/src/summary/linker_test.dart
index cd70c5dac03aaaf0a7a4a2f8de82a2d6ce799972..148b9affa2688a7552b18a664b739ea2289c2eb5 100644
--- a/pkg/analyzer/test/src/summary/linker_test.dart
+++ b/pkg/analyzer/test/src/summary/linker_test.dart
@@ -348,7 +348,7 @@ var y = C.x;
''');
LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
expect(_getVariable(library.getContainedName('y')).inferredType.toString(),
- '(D) → E');
+ '(D) → dynamic');
Brian Wilkerson 2017/03/17 22:39:42 Are these tests worth keeping? If we're not doing
scheglov 2017/03/18 01:54:52 It is partially a question of taste. Tests in this
}
void test_inferredType_instanceField_conditional_genericFunctions() {
@@ -489,11 +489,11 @@ class C {
addBundle('/a.ds', bundle);
createLinker('''
import 'a.dart';
-var x = new C().f; // Inferred type: int
+var x = new C().f; // Inferred type: dynamic
''');
LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
expect(_getVariable(library.getContainedName('x')).inferredType.toString(),
- 'int');
+ 'dynamic');
}
void test_inferredTypeFromOutsideBuildUnit_instanceField_toInstanceField() {
@@ -513,7 +513,7 @@ class D {
''');
LibraryElementForLink library = linker.getLibrary(linkerInputs.testDartUri);
ClassElementForLink_Class classD = library.getContainedName('D');
- expect(classD.fields[0].inferredType.toString(), 'int');
+ expect(classD.fields[0].inferredType.toString(), 'dynamic');
}
void test_inferredTypeFromOutsideBuildUnit_methodParamType_viaGeneric() {
« no previous file with comments | « pkg/analyzer/lib/src/task/strong_mode.dart ('k') | pkg/analyzer/test/src/summary/resynthesize_ast_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698