| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:21:10: Error: A value of type 'B' can't be assigned to a variable of type 'int'. |
| // - 'B' is from 'pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart'. |
| // Try changing the type of the variable. |
| // for (i in iterable) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:22:16: Error: A value of type 'B' can't be assigned to a variable of type 'int'. |
| // - 'B' is from 'pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart'. |
| // Try changing the type of the variable. |
| // await for (i in stream) {} |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:async" as asy; |
| |
| import "dart:async"; |
| |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| } |
| class B extends self::A { |
| synthetic constructor •() → self::B |
| : super self::A::•() |
| ; |
| } |
| static method f<T extends core::Object? = dynamic>() → self::f::T% |
| return throw ""; |
| static method test(core::Iterable<self::B> iterable, asy::Stream<self::B> stream, self::A a, self::B b, core::int i) → dynamic async /* futureValueType= dynamic */ { |
| for (final self::B #t1 in iterable) { |
| a = #t1; |
| } |
| await for (final self::B #t2 in stream) { |
| a = #t2; |
| } |
| for (final self::B #t3 in iterable) { |
| b = #t3; |
| } |
| await for (final self::B #t4 in stream) { |
| b = #t4; |
| } |
| for (final self::B #t5 in iterable) { |
| i = invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:21:10: Error: A value of type 'B' can't be assigned to a variable of type 'int'. |
| - 'B' is from 'pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart'. |
| Try changing the type of the variable. |
| for (i in iterable) {} |
| ^" in #t5 as{TypeError,ForNonNullableByDefault} core::int; |
| } |
| await for (final self::B #t6 in stream) { |
| i = invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:22:16: Error: A value of type 'B' can't be assigned to a variable of type 'int'. |
| - 'B' is from 'pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart'. |
| Try changing the type of the variable. |
| await for (i in stream) {} |
| ^" in #t6 as{TypeError,ForNonNullableByDefault} core::int; |
| } |
| for (final self::A #t7 in self::f<core::Iterable<self::A>>()) { |
| a = #t7; |
| } |
| await for (final self::A #t8 in self::f<asy::Stream<self::A>>()) { |
| a = #t8; |
| } |
| } |
| static method main() → dynamic {} |