blob: 7a50a154392ee5571663fa6d76d1c1f8968fade5 [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/forin.dart:9:17: Warning: Assigning value of type 'Iterable<int>?' to a variable of type 'Iterable<dynamic>'.
// - 'Iterable' is from 'dart:core'.
// for (int x in i2) x;
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:10:18: Warning: Assigning value of type 'Iterable<int>?' to a variable of type 'Iterable<dynamic>'.
// - 'Iterable' is from 'dart:core'.
// [for (int x in i2) x];
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:12:17: Warning: Assigning value of type 'List<int>?' to a variable of type 'Iterable<dynamic>'.
// - 'List' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// for (int x in l2) x;
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:13:18: Warning: Assigning value of type 'List<int>?' to a variable of type 'Iterable<dynamic>'.
// - 'List' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// [for (int x in l2) x];
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:15:17: Warning: Assigning value of type 'Object' to a variable of type 'Iterable<dynamic>'.
// - 'Object' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// for (int x in o1) x;
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:16:18: Warning: Assigning value of type 'Object' to a variable of type 'Iterable<dynamic>'.
// - 'Object' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// [for (int x in o1) x];
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:18:17: Warning: Assigning value of type 'Object?' to a variable of type 'Iterable<dynamic>'.
// - 'Object' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// for (int x in o2) x;
// ^
//
// pkg/front_end/testcases/nnbd/forin.dart:19:18: Warning: Assigning value of type 'Object?' to a variable of type 'Iterable<dynamic>'.
// - 'Object' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// [for (int x in o2) x];
// ^
//
import self as self;
import "dart:core" as core;
static method error(core::Iterable<core::int>? i2, core::List<core::int>? l2, core::Object o1, core::Object? o2) dynamic {
for (core::int x in i2)
x;
block {
final core::List<core::int> #t1 = <core::int>[];
for (core::int x in i2)
#t1.{core::List::add}(x);
} =>#t1;
for (core::int x in l2)
x;
block {
final core::List<core::int> #t2 = <core::int>[];
for (core::int x in l2)
#t2.{core::List::add}(x);
} =>#t2;
for (final dynamic #t3 in o1 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t3 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
x;
}
block {
final core::List<core::int> #t4 = <core::int>[];
for (final dynamic #t5 in o1 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t5 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
#t4.{core::List::add}(x);
}
} =>#t4;
for (final dynamic #t6 in o2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t6 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
x;
}
block {
final core::List<core::int> #t7 = <core::int>[];
for (final dynamic #t8 in o2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t8 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
#t7.{core::List::add}(x);
}
} =>#t7;
}
static method ok(core::Iterable<core::int> i1, core::List<core::int> l1, dynamic d) dynamic {
for (core::int x in i1)
x;
block {
final core::List<core::int> #t9 = <core::int>[];
for (core::int x in i1)
#t9.{core::List::add}(x);
} =>#t9;
for (core::int x in l1)
x;
block {
final core::List<core::int> #t10 = <core::int>[];
for (core::int x in l1)
#t10.{core::List::add}(x);
} =>#t10;
for (final dynamic #t11 in d as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t11 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
x;
}
block {
final core::List<core::int> #t12 = <core::int>[];
for (final dynamic #t13 in d as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
core::int x = #t13 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
#t12.{core::List::add}(x);
}
} =>#t12;
}
static method main() dynamic {}