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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 2983293002: Remove toplevel inference restriction hints, and restore as much (Closed)
Patch Set: Keep error filter Created 3 years, 5 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/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 2ac3cffd910bedd721264867d60b2015cffc6939..2807ba897e369f70f1f8ed07a4b0f3f92ee5efc1 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -3478,7 +3478,7 @@ class A {}
// A.a2 should now be fully resolved and inferred.
assertVariableDeclarationTypes(
- AstFinder.getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+ AstFinder.getFieldInClass(unit0, "A", "a2"), intType, intType);
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit1, "B", "b2"), intType, intType);
@@ -3589,7 +3589,7 @@ class A {}
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit0, "A", "a1"), intType, intType);
assertVariableDeclarationTypes(
- AstFinder.getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+ AstFinder.getFieldInClass(unit0, "A", "a2"), intType, intType);
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit1, "B", "b1"), intType, intType);
@@ -4292,10 +4292,9 @@ var tau = piFirst ? pi * 2 : 6.28;
CompilationUnit unit2 = units[2];
InterfaceType intType = context.typeProvider.intType;
- DartType dynamicType = context.typeProvider.dynamicType;
assertVariableDeclarationTypes(
- AstFinder.getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+ AstFinder.getFieldInClass(unit0, "A", "a2"), intType, intType);
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit1, "B", "b2"), intType, intType);
@@ -4303,7 +4302,7 @@ var tau = piFirst ? pi * 2 : 6.28;
List<Statement> statements =
AstFinder.getStatementsInTopLevelFunction(unit2, "test1");
- assertAssignmentStatementTypes(statements[1], intType, dynamicType);
+ assertAssignmentStatementTypes(statements[1], intType, intType);
}
// Test inference interactions between local variables and fields
@@ -4431,12 +4430,11 @@ var tau = piFirst ? pi * 2 : 6.28;
CompilationUnit unit2 = units[2];
InterfaceType intType = context.typeProvider.intType;
- DartType dynamicType = context.typeProvider.dynamicType;
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit0, "A", "a1"), intType, intType);
assertVariableDeclarationTypes(
- AstFinder.getFieldInClass(unit0, "A", "a2"), dynamicType, intType);
+ AstFinder.getFieldInClass(unit0, "A", "a2"), intType, intType);
assertVariableDeclarationTypes(
AstFinder.getFieldInClass(unit1, "B", "b1"), intType, intType);
@@ -4447,7 +4445,7 @@ var tau = piFirst ? pi * 2 : 6.28;
AstFinder.getStatementsInTopLevelFunction(unit2, "test1");
assertAssignmentStatementTypes(statements[1], intType, intType);
- assertAssignmentStatementTypes(statements[2], intType, dynamicType);
+ assertAssignmentStatementTypes(statements[2], intType, intType);
}
// Test inference across units (non-cyclic)
« no previous file with comments | « pkg/analyzer/test/src/summary/top_level_inference_test.dart ('k') | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698