blob: 304f6a205b7e7772fc67d2ca28a6b61950e9c687 [file] [log] [blame]
library test;
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
abstract class MyStream<T extends core::Object = dynamic> extends asy::Stream<self::MyStream::T> {
static factory •<T extends core::Object = dynamic>() self::MyStream<self::MyStream::•::T>
return null;
}
static method foo() asy::Stream<core::List<core::int>> /* originally async* */ {
asy::_AsyncStarStreamController<core::List<core::int>> :controller;
dynamic :controller_stream;
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;
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) dynamic yielding
try
try {
#L1:
{
if(:controller.{asy::_AsyncStarStreamController::add}(<core::int>[]))
return null;
else
[yield] null;
if(:controller.{asy::_AsyncStarStreamController::add}(let final<BottomType> #t1 = invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:67: Error: A value of type 'test::MyStream<dynamic>' can't be assigned to a variable of type 'dart.core::List<dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::List<dart.core::int>'.
yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ MyStream();
^" in self::MyStream::•<dynamic>() as{TypeError} core::List<core::int>))
return null;
else
[yield] null;
if(:controller.{asy::_AsyncStarStreamController::addStream}(let final<BottomType> #t2 = invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:64: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.async::Stream<dart.core::List<dart.core::int>>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.async::Stream<dart.core::List<dart.core::int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
^" in <dynamic>[] as{TypeError} asy::Stream<core::List<core::int>>))
return null;
else
[yield] null;
if(:controller.{asy::_AsyncStarStreamController::addStream}(self::MyStream::•<core::List<core::int>>()))
return null;
else
[yield] null;
}
return;
}
on dynamic catch(dynamic :exception, dynamic :stack_trace) {
:controller.{asy::_AsyncStarStreamController::addError}(:exception, :stack_trace);
}
finally {
:controller.{asy::_AsyncStarStreamController::close}();
}
:async_stack_trace = asy::_asyncStackTraceHelper(:async_op);
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
:controller = new asy::_AsyncStarStreamController::•<core::List<core::int>>(:async_op);
:controller_stream = :controller.{asy::_AsyncStarStreamController::stream};
return :controller_stream;
}
static method bar() → core::Iterable<core::Map<core::int, core::int>> /* originally sync* */ {
dynamic :await_jump_var = 0;
dynamic :await_ctx_var;
function :sync_op(core::_SyncIterator<core::Map<core::int, core::int>> :iterator) → core::bool yielding {
{
{
:iterator.{core::_SyncIterator::_current} = <core::int, core::int>{};
[yield] true;
}
{
:iterator.{core::_SyncIterator::_current} = let final<BottomType> #t3 = invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:67: Error: A value of type 'dart.core::List<dynamic>' can't be assigned to a variable of type 'dart.core::Map<dart.core::int, dart.core::int>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Map<dart.core::int, dart.core::int>'.
yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ List();
^" in core::_GrowableList::•<dynamic>(0) as{TypeError} core::Map<core::int, core::int>;
[yield] true;
}
{
:iterator.{core::_SyncIterator::_yieldEachIterable} = let final<BottomType> #t4 = invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:73: Error: A value of type 'dart.core::Map<dynamic, dynamic>' can't be assigned to a variable of type 'dart.core::Iterable<dart.core::Map<dart.core::int, dart.core::int>>'.
Try changing the type of the left hand side, or casting the right hand side to 'dart.core::Iterable<dart.core::Map<dart.core::int, dart.core::int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic, dynamic*/ {};
^" in <dynamic, dynamic>{} as{TypeError} core::Iterable<core::Map<core::int, core::int>>;
[yield] true;
}
{
:iterator.{core::_SyncIterator::_yieldEachIterable} = core::_GrowableList::•<core::Map<core::int, core::int>>(0);
[yield] true;
}
}
return false;
}
return new core::_SyncIterable::•<core::Map<core::int, core::int>>(:sync_op);
}
static method main() → dynamic {}