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

Unified Diff: pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart

Issue 2868133002: Fix annotation of promoted parameters in Fasta inference tests. (Closed)
Patch Set: Created 3 years, 7 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/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart
diff --git a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart
index 483aaa1f14d19147d206780d513953d0a73b2acf..6e56f082065a56a6df8e2736f07c3dda823ef66b 100644
--- a/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart
+++ b/pkg/front_end/testcases/inference/infer_types_on_loop_indices_for_each_loop.dart
@@ -11,7 +11,7 @@ class Foo {
class Bar<T extends Iterable<String>> {
void foo(T t) {
- for (var /*@promotedType=none*/ i in t) {
+ for (var i in /*@promotedType=none*/ t) {
int x = /*error:INVALID_ASSIGNMENT*/ /*@promotedType=none*/ i;
}
}
@@ -19,7 +19,7 @@ class Bar<T extends Iterable<String>> {
class Baz<T, E extends Iterable<T>, S extends E> {
void foo(S t) {
- for (var /*@promotedType=none*/ i in t) {
+ for (var i in /*@promotedType=none*/ t) {
int x = /*error:INVALID_ASSIGNMENT*/ /*@promotedType=none*/ i;
T y = /*@promotedType=none*/ i;
}
@@ -28,15 +28,15 @@ class Baz<T, E extends Iterable<T>, S extends E> {
test() {
var /*@type=List<Foo>*/ list = <Foo>[];
- for (var /*@promotedType=none*/ x in /*@promotedType=none*/ list) {
+ for (var x in /*@promotedType=none*/ list) {
String y = /*error:INVALID_ASSIGNMENT*/ /*@promotedType=none*/ x;
}
- for (dynamic /*@promotedType=none*/ x in /*@promotedType=none*/ list) {
+ for (dynamic x in /*@promotedType=none*/ list) {
String y = /*info:DYNAMIC_CAST*/ /*@promotedType=none*/ x;
}
- for (String /*@promotedType=none*/ x
+ for (String x
in /*error:FOR_IN_OF_INVALID_ELEMENT_TYPE*/ /*@promotedType=none*/ list) {
String y = /*@promotedType=none*/ x;
}
@@ -47,27 +47,25 @@ test() {
}
Iterable iter = /*@promotedType=none*/ list;
- for (Foo /*info:DYNAMIC_CAST*/ /*@promotedType=none*/ x
- in /*@promotedType=none*/ iter) {
+ for (Foo /*info:DYNAMIC_CAST*/ x in /*@promotedType=none*/ iter) {
var /*@type=Foo*/ y = /*@promotedType=none*/ x;
}
dynamic iter2 = /*@promotedType=none*/ list;
- for (Foo /*info:DYNAMIC_CAST*/ /*@promotedType=none*/ x
+ for (Foo /*info:DYNAMIC_CAST*/ x
in /*info:DYNAMIC_CAST*/ /*@promotedType=none*/ iter2) {
var /*@type=Foo*/ y = /*@promotedType=none*/ x;
}
var /*@type=Map<String, Foo>*/ map = <String, Foo>{};
// Error: map must be an Iterable.
- for (var /*@promotedType=none*/ x
- in /*error:FOR_IN_OF_INVALID_TYPE*/ /*@promotedType=none*/ map) {
+ for (var x in /*error:FOR_IN_OF_INVALID_TYPE*/ /*@promotedType=none*/ map) {
String y = /*info:DYNAMIC_CAST*/ /*@promotedType=none*/ x;
}
// We're not properly inferring that map.keys is an Iterable<String>
// and that x is a String.
- for (var /*@promotedType=none*/ x in /*@promotedType=none*/ map.keys) {
+ for (var x in /*@promotedType=none*/ map.keys) {
String y = /*@promotedType=none*/ x;
}
}

Powered by Google App Engine
This is Rietveld 408576698