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

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

Issue 2782533002: Report errors for the new top-level inference rules. (Closed)
Patch Set: Update language_strong status for analyzer. 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/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 2bb0a75deed654bbf4b91de3295109ab350b4a96..f4349cbbcfbae63364dd35e565c7a86f3ec5667c 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -2918,10 +2918,7 @@ class M {}
'/test.dart',
'''
var X = 1;
-
-var Y = () {
- return 1 + X;
-};
+var Y = () => 1 + X;
''');
computeResult(new LibrarySpecificUnit(source, source), RESOLVED_UNIT8,
matcher: isInferStaticVariableTypesInUnitTask);
@@ -2929,9 +2926,8 @@ var Y = () {
TopLevelVariableDeclaration declaration = unit.declarations[1];
FunctionExpression function =
declaration.variables.variables[0].initializer;
- BlockFunctionBody body = function.body;
- ReturnStatement statement = body.block.statements[0];
- Expression expression = statement.expression;
+ ExpressionFunctionBody body = function.body;
+ Expression expression = body.expression;
InterfaceType intType = context.typeProvider.intType;
expect(expression.staticType, intType);
}
« no previous file with comments | « pkg/analyzer/test/src/summary/top_level_inference_test.dart ('k') | pkg/analyzer/test/src/task/strong/checker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698