blob: 399a9d464b061f49c908c2cc3fb1c115772b4ce0 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
class A extends core::Object {
synthetic constructor •() void
: super core::Object::•()
;
}
class B extends self::A {
synthetic constructor •() void
: super self::A::•()
;
}
static method f<T extends core::Object = dynamic>() self::f::T
return null;
static method test() dynamic /* originally async */ {
final asy::Completer<dynamic> :async_completer = asy::Completer::sync<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;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(stream);
try
#L2:
while (true) {
[yield] let dynamic #t2 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
final self::A #t3 = :for-iterator.{asy::_StreamIterator::current};
{
a = #t3;
}
}
else
break #L2;
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
[yield] let dynamic #t4 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
for (final self::A #t5 in iterable) {
b = #t5 as{TypeError} self::B;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(stream);
try
#L3:
while (true) {
[yield] let dynamic #t6 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
final self::A #t7 = :for-iterator.{asy::_StreamIterator::current};
{
b = #t7 as{TypeError} self::B;
}
}
else
break #L3;
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
[yield] let dynamic #t8 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
for (final self::A #t9 in iterable) {
i = let<BottomType> _ = null in let final dynamic #t10 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:26:39: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
for (i /*@error=InvalidAssignment*/ in iterable) {}
^" in let final self::A #t11 = #t9 in null;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(stream);
try
#L4:
while (true) {
[yield] let dynamic #t12 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
final self::A #t13 = :for-iterator.{asy::_StreamIterator::current};
{
i = let<BottomType> _ = null in let final dynamic #t14 = let<BottomType> _ = null in invalid-expression "pkg/front_end/testcases/inference_new/for_each_outer_var_type.dart:27:45: Error: A value of type 'test::A' can't be assigned to a variable of type 'dart.core::int'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::int'.
await for (i /*@error=InvalidAssignment*/ in stream) {}
^" in let final self::A #t15 = #t13 in null;
}
}
else
break #L4;
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
[yield] let dynamic #t16 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(), :async_op_then, :async_op_error, :async_op) in null;
:result;
}
}
for (final self::A #t17 in self::f<core::Iterable<self::A>>()) {
a = #t17;
}
{
asy::_StreamIterator<self::A> :for-iterator = new asy::_StreamIterator::•<self::A>(self::f<asy::Stream<self::A>>());
try
#L5:
while (true) {
[yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(), :async_op_then, :async_op_error, :async_op) in null;
if(:result) {
final self::A #t19 = :for-iterator.{asy::_StreamIterator::current};
{
a = #t19;
}
}
else
break #L5;
}
finally
if(!:for-iterator.{asy::_StreamIterator::_subscription}.{core::Object::==}(null)) {
[yield] let dynamic #t20 = 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);
asy::Future::microtask<dynamic>(:async_op);
return :async_completer.{asy::Completer::future};
}
static method main() → dynamic {}