blob: c9f269d3cb615b39895d25a19afcd3d64036d929 [file] [log] [blame]
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:_internal" as _in;
import "dart:async";
class A extends core::Object {
synthetic constructor •() self::A*
: super core::Object::•()
;
abstract member-signature get _identityHashCode() core::int*; -> core::Object::_identityHashCode
abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) core::bool*; -> core::Object::_instanceOf
abstract member-signature method _simpleInstanceOf(dynamic type) core::bool*; -> core::Object::_simpleInstanceOf
abstract member-signature method _simpleInstanceOfTrue(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfTrue
abstract member-signature method _simpleInstanceOfFalse(dynamic type) core::bool*; -> core::Object::_simpleInstanceOfFalse
abstract member-signature operator ==(dynamic other) core::bool*; -> core::Object::==
abstract member-signature get hashCode() core::int*; -> core::Object::hashCode
abstract member-signature method toString() core::String*; -> core::Object::toString
abstract member-signature method noSuchMethod(core::Invocation* invocation) dynamic; -> core::Object::noSuchMethod
abstract member-signature get runtimeType() core::Type*; -> core::Object::runtimeType
}
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::_Future<dynamic>* :async_future = new asy::_Future::•<dynamic>();
core::bool* :is_sync = false;
FutureOr<dynamic>* :return_value;
(dynamic) →* dynamic :async_op_then;
(core::Object*, core::StackTrace*) →* dynamic :async_op_error;
core::int* :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;
{
core::Iterator<self::A*>* :sync-for-iterator = iterable.{core::Iterable::iterator};
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
final self::A* #t1 = :sync-for-iterator.{core::Iterator::current};
{
a = #t1;
}
}
}
{
asy::Stream<self::A*>* :stream = stream;
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(_in::unsafeCast<core::bool>(: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;
}
}
{
core::Iterator<self::A*>* :sync-for-iterator = iterable.{core::Iterable::iterator};
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
final self::A* #t6 = :sync-for-iterator.{core::Iterator::current};
{
b = #t6 as{TypeError} self::B*;
}
}
}
{
asy::Stream<self::A*>* :stream = stream;
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(_in::unsafeCast<core::bool>(: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;
}
}
{
core::Iterator<self::A*>* :sync-for-iterator = iterable.{core::Iterable::iterator};
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
final self::A* #t11 = :sync-for-iterator.{core::Iterator::current};
{
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*;
}
}
}
{
asy::Stream<self::A*>* :stream = stream;
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(_in::unsafeCast<core::bool>(: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;
}
}
{
core::Iterator<self::A*>* :sync-for-iterator = self::f<core::Iterable<self::A*>*>().{core::Iterable::iterator};
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
final self::A* #t18 = :sync-for-iterator.{core::Iterator::current};
{
a = #t18;
}
}
}
{
asy::Stream<self::A*>* :stream = self::f<asy::Stream<self::A*>*>();
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(_in::unsafeCast<core::bool>(: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_future, :return_value, :is_sync);
return;
}
on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync);
}
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
:async_op.call();
:is_sync = true;
return :async_future;
}
static method main() → dynamic {}