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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_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/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index e976f09ccc92771bd55460271377a6d30195ecb9..361d57742a0eb50d4384ac618030f785325be636 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -2205,7 +2205,9 @@ main() {
}
test_implicitCasts_genericMethods() async {
- addFile('var x = <String>[].map((x) => "");');
+ addFile('''
+var x = <String>[].map<String>((x) => "");
+''');
await check(implicitCasts: false);
}
@@ -2225,7 +2227,8 @@ void f() {
addFile(r'''
class C {
var /*error:IMPLICIT_DYNAMIC_FIELD*/x0;
- var /*error:IMPLICIT_DYNAMIC_FIELD*/x1 = (<dynamic>[])[0];
+ var /*error:IMPLICIT_DYNAMIC_FIELD*/x1 =
+ /*error:TOP_LEVEL_UNSUPPORTED*/(<dynamic>[])[0];
var /*error:IMPLICIT_DYNAMIC_FIELD*/x2,
x3 = 42,
/*error:IMPLICIT_DYNAMIC_FIELD*/x4;
@@ -2452,7 +2455,8 @@ A g(B b) {
test_implicitDynamic_variable() async {
addFile(r'''
var /*error:IMPLICIT_DYNAMIC_VARIABLE*/x0;
-var /*error:IMPLICIT_DYNAMIC_VARIABLE*/x1 = (<dynamic>[])[0];
+var /*error:IMPLICIT_DYNAMIC_VARIABLE*/x1 =
+ /*error:TOP_LEVEL_UNSUPPORTED*/(<dynamic>[])[0];
var /*error:IMPLICIT_DYNAMIC_VARIABLE*/x2,
x3 = 42,
/*error:IMPLICIT_DYNAMIC_VARIABLE*/x4;
« no previous file with comments | « pkg/analyzer/test/src/task/dart_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