| 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 */ { |
| { |
| core::Iterator<self::B> :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<self::B>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final self::B #t1 = :sync-for-iterator.{core::Iterator::current}{self::B}; |
| { |
| a = #t1; |
| } |
| } |
| } |
| { |
| asy::Stream<self::B> :stream = stream; |
| asy::_StreamIterator<self::B>? :for-iterator = new asy::_StreamIterator::•<self::B>(:stream); |
| try |
| while (let dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream) in await :for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}) { |
| final self::B #t3 = :for-iterator.{asy::_StreamIterator::current}{self::B}; |
| { |
| a = #t3; |
| } |
| } |
| finally |
| if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::B>?} == null)) |
| await :for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}; |
| } |
| { |
| core::Iterator<self::B> :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<self::B>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final self::B #t4 = :sync-for-iterator.{core::Iterator::current}{self::B}; |
| { |
| b = #t4; |
| } |
| } |
| } |
| { |
| asy::Stream<self::B> :stream = stream; |
| asy::_StreamIterator<self::B>? :for-iterator = new asy::_StreamIterator::•<self::B>(:stream); |
| try |
| while (let dynamic #t5 = asy::_asyncStarMoveNextHelper(:stream) in await :for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}) { |
| final self::B #t6 = :for-iterator.{asy::_StreamIterator::current}{self::B}; |
| { |
| b = #t6; |
| } |
| } |
| finally |
| if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::B>?} == null)) |
| await :for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}; |
| } |
| { |
| core::Iterator<self::B> :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<self::B>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final self::B #t7 = :sync-for-iterator.{core::Iterator::current}{self::B}; |
| { |
| 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 #t7 as{TypeError,ForNonNullableByDefault} core::int; |
| } |
| } |
| } |
| { |
| asy::Stream<self::B> :stream = stream; |
| asy::_StreamIterator<self::B>? :for-iterator = new asy::_StreamIterator::•<self::B>(:stream); |
| try |
| while (let dynamic #t8 = asy::_asyncStarMoveNextHelper(:stream) in await :for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}) { |
| final self::B #t9 = :for-iterator.{asy::_StreamIterator::current}{self::B}; |
| { |
| 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 #t9 as{TypeError,ForNonNullableByDefault} core::int; |
| } |
| } |
| finally |
| if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::B>?} == null)) |
| await :for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}; |
| } |
| { |
| core::Iterator<self::A> :sync-for-iterator = self::f<core::Iterable<self::A>>().{core::Iterable::iterator}{core::Iterator<self::A>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final self::A #t10 = :sync-for-iterator.{core::Iterator::current}{self::A}; |
| { |
| a = #t10; |
| } |
| } |
| } |
| { |
| asy::Stream<self::A> :stream = self::f<asy::Stream<self::A>>(); |
| asy::_StreamIterator<self::A>? :for-iterator = new asy::_StreamIterator::•<self::A>(:stream); |
| try |
| while (let dynamic #t11 = asy::_asyncStarMoveNextHelper(:stream) in await :for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}) { |
| final self::A #t12 = :for-iterator.{asy::_StreamIterator::current}{self::A}; |
| { |
| a = #t12; |
| } |
| } |
| finally |
| if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::A>?} == null)) |
| await :for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}; |
| } |
| } |
| static method main() → dynamic {} |