c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
150 lines
7.5 KiB
Plaintext
150 lines
7.5 KiB
Plaintext
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 let final Never #t1 = 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> #t2 = <core::int>[];
|
|
for (core::int x in let final Never #t3 = 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>)
|
|
#t2.{core::List::add}{Invariant}(x);
|
|
} =>#t2;
|
|
for (core::int x in let final Never #t4 = 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> #t5 = <core::int>[];
|
|
for (core::int x in let final Never #t6 = 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>)
|
|
#t5.{core::List::add}{Invariant}(x);
|
|
} =>#t5;
|
|
for (final dynamic #t7 in let final Never #t8 = 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 = #t7 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
x;
|
|
}
|
|
block {
|
|
final core::List<core::int> #t9 = <core::int>[];
|
|
for (final dynamic #t10 in let final Never #t11 = 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 = #t10 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
#t9.{core::List::add}{Invariant}(x);
|
|
}
|
|
} =>#t9;
|
|
for (final dynamic #t12 in let final Never #t13 = 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 = #t12 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
x;
|
|
}
|
|
block {
|
|
final core::List<core::int> #t14 = <core::int>[];
|
|
for (final dynamic #t15 in let final Never #t16 = 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 = #t15 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
#t14.{core::List::add}{Invariant}(x);
|
|
}
|
|
} =>#t14;
|
|
}
|
|
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> #t17 = <core::int>[];
|
|
for (core::int x in i1)
|
|
#t17.{core::List::add}{Invariant}(x);
|
|
} =>#t17;
|
|
for (core::int x in l1)
|
|
x;
|
|
block {
|
|
final core::List<core::int> #t18 = <core::int>[];
|
|
for (core::int x in l1)
|
|
#t18.{core::List::add}{Invariant}(x);
|
|
} =>#t18;
|
|
for (final dynamic #t19 in d as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
|
|
core::int x = #t19 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
x;
|
|
}
|
|
block {
|
|
final core::List<core::int> #t20 = <core::int>[];
|
|
for (final dynamic #t21 in d as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<dynamic>) {
|
|
core::int x = #t21 as{TypeError,ForDynamic,ForNonNullableByDefault} core::int;
|
|
#t20.{core::List::add}{Invariant}(x);
|
|
}
|
|
} =>#t20;
|
|
}
|
|
static method main() → dynamic {}
|