| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:10: Error: A value of type 'A' can't be assigned to a variable of type 'int'. |
| // - 'A' 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:27:16: Error: A value of type 'A' can't be assigned to a variable of type 'int'. |
| // - 'A' 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 null; |
| static method test() → dynamic /* originally async */ { |
| final asy::_AsyncAwaitCompleter<dynamic>* :async_completer = new asy::_AsyncAwaitCompleter::•<dynamic>(); |
| asy::FutureOr<dynamic>* :return_value; |
| dynamic :async_stack_trace; |
| dynamic :async_op_then; |
| dynamic :async_op_error; |
| dynamic :await_jump_var = 0; |
| dynamic :await_ctx_var; |
| dynamic :saved_try_context_var0; |
| dynamic :saved_try_context_var1; |
| dynamic :exception0; |
| dynamic :stack_trace0; |
| function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding |
| try { |
| #L1: |
| { |
| core::Iterable<self::A*>* iterable; |
| asy::Stream<self::A*>* stream; |
| self::A* a; |
| self::B* b; |
| core::int* i; |
| for (final self::A* #t1 in iterable) { |
| a = #t1; |
| } |
| { |
| dynamic :stream = stream; |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<self::A*>* :for-iterator = new asy::_StreamIterator::•<self::A*>(:stream); |
| try |
| #L2: |
| while (true) { |
| dynamic #t2 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t3 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final self::A* #t4 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| a = #t4; |
| } |
| } |
| else |
| break #L2; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null; |
| :result; |
| } |
| } |
| for (final self::A* #t6 in iterable) { |
| b = #t6 as{TypeError} self::B*; |
| } |
| { |
| dynamic :stream = stream; |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<self::A*>* :for-iterator = new asy::_StreamIterator::•<self::A*>(:stream); |
| try |
| #L3: |
| while (true) { |
| dynamic #t7 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final self::A* #t9 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| b = #t9 as{TypeError} self::B*; |
| } |
| } |
| else |
| break #L3; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null; |
| :result; |
| } |
| } |
| for (final self::A* #t11 in iterable) { |
| i = let final<BottomType> #t12 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:10: Error: A value of type 'A' can't be assigned to a variable of type 'int'. |
| - 'A' 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 #t11 as{TypeError} core::int*; |
| } |
| { |
| dynamic :stream = stream; |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<self::A*>* :for-iterator = new asy::_StreamIterator::•<self::A*>(:stream); |
| try |
| #L4: |
| while (true) { |
| dynamic #t13 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t14 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final self::A* #t15 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| i = let final<BottomType> #t16 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:16: Error: A value of type 'A' can't be assigned to a variable of type 'int'. |
| - 'A' 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 #t15 as{TypeError} core::int*; |
| } |
| } |
| else |
| break #L4; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t17 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null; |
| :result; |
| } |
| } |
| for (final self::A* #t18 in self::f<core::Iterable<self::A*>*>()) { |
| a = #t18; |
| } |
| { |
| dynamic :stream = self::f<asy::Stream<self::A*>*>(); |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<self::A*>* :for-iterator = new asy::_StreamIterator::•<self::A*>(:stream); |
| try |
| #L5: |
| while (true) { |
| dynamic #t19 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final self::A* #t21 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| a = #t21; |
| } |
| } |
| else |
| break #L5; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t22 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null; |
| :result; |
| } |
| } |
| } |
| asy::_completeOnAsyncReturn(:async_completer, :return_value); |
| return; |
| } |
| on dynamic catch(dynamic :exception, dynamic :stack_trace) { |
| :async_completer.{asy::Completer::completeError}(:exception, :stack_trace); |
| } |
| :async_stack_trace = asy::_asyncStackTraceHelper(:async_op); |
| :async_op_then = asy::_asyncThenWrapperHelper(:async_op); |
| :async_op_error = asy::_asyncErrorWrapperHelper(:async_op); |
| :async_completer.start(:async_op); |
| return :async_completer.{asy::Completer::future}; |
| } |
| static method main() → dynamic {} |