blob: 703f7d820166f82e72497e64ca14019f9c0c17f3 [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;
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_or_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}{core::Iterator<self::A*>*};
for (; :sync-for-iterator.{core::Iterator::moveNext}(){() core::bool}; ) {
final self::A* #t1 = :sync-for-iterator.{core::Iterator::current}{self::A*};
{
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}(){() → asy::Future<core::bool>}, :async_op_then, :async_op_error) in null;
if(_in::unsafeCast<core::bool>(:result_or_exception)) {
final self::A* #t4 = :for-iterator.{asy::_StreamIterator::current}{self::A*};
{
a = #t4;
}
}
else
break #L2;
}
finally
if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::A*>?} == null)) {
[yield] let dynamic #t5 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}, :async_op_then, :async_op_error) in null;
:result_or_exception;
}
}
{
core::Iterator<self::A*>* :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<self::A*>*};
for (; :sync-for-iterator.{core::Iterator::moveNext}(){() core::bool}; ) {
final self::A* #t6 = :sync-for-iterator.{core::Iterator::current}{self::A*};
{
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}(){() → asy::Future<core::bool>}, :async_op_then, :async_op_error) in null;
if(_in::unsafeCast<core::bool>(:result_or_exception)) {
final self::A* #t9 = :for-iterator.{asy::_StreamIterator::current}{self::A*};
{
b = #t9 as{TypeError} self::B*;
}
}
else
break #L3;
}
finally
if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::A*>?} == null)) {
[yield] let dynamic #t10 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}, :async_op_then, :async_op_error) in null;
:result_or_exception;
}
}
{
core::Iterator<self::A*>* :sync-for-iterator = iterable.{core::Iterable::iterator}{core::Iterator<self::A*>*};
for (; :sync-for-iterator.{core::Iterator::moveNext}(){() core::bool}; ) {
final self::A* #t11 = :sync-for-iterator.{core::Iterator::current}{self::A*};
{
i = 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 #t12 = asy::_asyncStarMoveNextHelper(:stream);
[yield] let dynamic #t13 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}, :async_op_then, :async_op_error) in null;
if(_in::unsafeCast<core::bool>(:result_or_exception)) {
final self::A* #t14 = :for-iterator.{asy::_StreamIterator::current}{self::A*};
{
i = 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 #t14 as{TypeError} core::int*;
}
}
else
break #L4;
}
finally
if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::A*>?} == null)) {
[yield] let dynamic #t15 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}, :async_op_then, :async_op_error) in null;
:result_or_exception;
}
}
{
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* #t16 = :sync-for-iterator.{core::Iterator::current}{self::A*};
{
a = #t16;
}
}
}
{
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 #t17 = asy::_asyncStarMoveNextHelper(:stream);
[yield] let dynamic #t18 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::moveNext}(){() → asy::Future<core::bool>}, :async_op_then, :async_op_error) in null;
if(_in::unsafeCast<core::bool>(:result_or_exception)) {
final self::A* #t19 = :for-iterator.{asy::_StreamIterator::current}{self::A*};
{
a = #t19;
}
}
else
break #L5;
}
finally
if(!(:for-iterator.{asy::_StreamIterator::_subscription}{asy::StreamSubscription<self::A*>?} == null)) {
[yield] let dynamic #t20 = asy::_awaitHelper(:for-iterator.{asy::_StreamIterator::cancel}(){() → asy::Future<dynamic>}, :async_op_then, :async_op_error) in null;
:result_or_exception;
}
}
}
asy::_completeWithNoFutureOnAsyncReturn(: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(null, null){() →* dynamic};
:is_sync = true;
return :async_future;
}
static method main() dynamic {}