| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/forin.dart:9:17: Error: The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| // - 'Iterable' is from 'dart:core'. |
| // for (int x in i2) x; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/forin.dart:10:18: Error: The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| // - 'Iterable' is from 'dart:core'. |
| // [for (int x in i2) x]; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/forin.dart:12:17: Error: The type 'List<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'List<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| // - '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: Error: The type 'List<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'List<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| // - '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: Error: The type 'Object' used in the 'for' loop must implement '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: Error: The type 'Object' used in the 'for' loop must implement '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: Error: The type 'Object?' used in the 'for' loop must implement '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: Error: The type 'Object?' used in the 'for' loop must implement '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 invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:9:17: Error: The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| - 'Iterable' is from 'dart:core'. |
| for (int x in i2) x; |
| ^" in i2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) |
| x; |
| block { |
| final core::List<core::int> #t1 = <core::int>[]; |
| for (core::int x in invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:10:18: Error: The type 'Iterable<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'Iterable<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| - 'Iterable' is from 'dart:core'. |
| [for (int x in i2) x]; |
| ^" in i2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) |
| #t1.{core::List::add}{Invariant}(x){(core::int) → void}; |
| } =>#t1; |
| for (core::int x in invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:12:17: Error: The type 'List<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'List<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| - 'List' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| for (int x in l2) x; |
| ^" in l2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) |
| x; |
| block { |
| final core::List<core::int> #t2 = <core::int>[]; |
| for (core::int x in invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:13:18: Error: The type 'List<int>?' used in the 'for' loop must implement 'Iterable<dynamic>' because 'List<int>?' is nullable and 'Iterable<dynamic>' isn't. |
| - 'List' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| [for (int x in l2) x]; |
| ^" in l2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) |
| #t2.{core::List::add}{Invariant}(x){(core::int) → void}; |
| } =>#t2; |
| for (final dynamic #t3 in invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:15:17: Error: The type 'Object' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Object' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| for (int x in o1) x; |
| ^" 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 invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:16:18: Error: The type 'Object' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Object' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| [for (int x in o1) x]; |
| ^" in o1 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) { |
| core::int x = #t5 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int; |
| #t4.{core::List::add}{Invariant}(x){(core::int) → void}; |
| } |
| } =>#t4; |
| for (final dynamic #t6 in invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:18:17: Error: The type 'Object?' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Object' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| for (int x in o2) x; |
| ^" 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 invalid-expression "pkg/front_end/testcases/nnbd/forin.dart:19:18: Error: The type 'Object?' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Object' is from 'dart:core'. |
| - 'Iterable' is from 'dart:core'. |
| [for (int x in o2) x]; |
| ^" in o2 as{TypeError,ForNonNullableByDefault} core::Iterable<dynamic>) { |
| core::int x = #t8 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int; |
| #t7.{core::List::add}{Invariant}(x){(core::int) → void}; |
| } |
| } =>#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}{Invariant}(x){(core::int) → void}; |
| } =>#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}{Invariant}(x){(core::int) → void}; |
| } =>#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}{Invariant}(x){(core::int) → void}; |
| } |
| } =>#t12; |
| } |
| static method main() → dynamic {} |