| library test; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:17: Error: The type 'String' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| // - 'Iterable' is from 'dart:core'. |
| // for (int x in s) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:23: Error: The type 'String' used in the 'for' loop must implement 'Stream<dynamic>'. |
| // - 'Stream' is from 'dart:async'. |
| // await for (int x in s) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:13: Error: The type 'String' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| // - 'Iterable' is from 'dart:core'. |
| // for (y in s) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:19: Error: The type 'String' used in the 'for' loop must implement 'Stream<dynamic>'. |
| // - 'Stream' is from 'dart:async'. |
| // await for (y in s) {} |
| // ^ |
| // |
| import self as self; |
| import "dart:async" as asy; |
| import "dart:core" as core; |
| |
| 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::String* s; |
| for (final dynamic #t1 in let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:10:17: Error: The type 'String' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Iterable' is from 'dart:core'. |
| for (int x in s) {} |
| ^" in s as{TypeError} core::Iterable<dynamic>*) { |
| core::int* x = #t1 as{TypeError} core::int*; |
| } |
| { |
| dynamic :stream = let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:11:23: Error: The type 'String' used in the 'for' loop must implement 'Stream<dynamic>'. |
| - 'Stream' is from 'dart:async'. |
| await for (int x in s) {} |
| ^" in s as{TypeError} asy::Stream<dynamic>*; |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<dynamic>* :for-iterator = new asy::_StreamIterator::•<dynamic>(:stream); |
| try |
| #L2: |
| while (true) { |
| dynamic #t4 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final dynamic #t6 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| core::int* x = #t6 as{TypeError} core::int*; |
| } |
| } |
| else |
| break #L2; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t7 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null; |
| :result; |
| } |
| } |
| core::int* y; |
| for (final dynamic #t8 in let final<BottomType> #t9 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:13:13: Error: The type 'String' used in the 'for' loop must implement 'Iterable<dynamic>'. |
| - 'Iterable' is from 'dart:core'. |
| for (y in s) {} |
| ^" in s as{TypeError} core::Iterable<dynamic>*) { |
| y = #t8 as{TypeError} core::int*; |
| } |
| { |
| dynamic :stream = let final<BottomType> #t10 = invalid-expression "pkg/front_end/testcases/inference_new/for_each_invalid_iterable.dart:14:19: Error: The type 'String' used in the 'for' loop must implement 'Stream<dynamic>'. |
| - 'Stream' is from 'dart:async'. |
| await for (y in s) {} |
| ^" in s as{TypeError} asy::Stream<dynamic>*; |
| asy::_asyncStarListenHelper(:stream, :async_op); |
| asy::_StreamIterator<dynamic>* :for-iterator = new asy::_StreamIterator::•<dynamic>(:stream); |
| try |
| #L3: |
| while (true) { |
| dynamic #t11 = asy::_asyncStarMoveNextHelper(:stream); |
| [yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null; |
| if(:result) { |
| final dynamic #t13 = :for-iterator.{asy::_StreamIterator::current}; |
| { |
| y = #t13 as{TypeError} core::int*; |
| } |
| } |
| else |
| break #L3; |
| } |
| finally |
| if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) { |
| [yield] let dynamic #t14 = 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 {} |