blob: c318392411a5f1e1d816080707af0a4bb3204173 [file] [log] [blame]
library test;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:67: Error: A value of type 'MyStream<dynamic>' can't be assigned to a variable of type 'List<int>'.
// - 'MyStream' is from 'pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart'.
// - 'List' is from 'dart:core'.
// Try changing the type of the left hand side, or casting the right hand side to 'List<int>'.
// yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ MyStream();
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:68: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'Stream<List<int>>'.
// - 'List' is from 'dart:core'.
// - 'Stream' is from 'dart:async'.
// Try changing the type of the left hand side, or casting the right hand side to 'Stream<List<int>>'.
// yield* /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ List();
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:67: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'Map<int, int>'.
// - 'List' is from 'dart:core'.
// - 'Map' is from 'dart:core'.
// Try changing the type of the left hand side, or casting the right hand side to 'Map<int, int>'.
// yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ List();
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:77: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'Iterable<Map<int, int>>'.
// - 'Map' is from 'dart:core'.
// - 'Iterable' is from 'dart:core'.
// Try changing the type of the left hand side, or casting the right hand side to 'Iterable<Map<int, int>>'.
// yield* /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic, dynamic*/ Map();
// ^
//
import self as self;
import "dart:core" as core;
import "dart:async" as asy;
import "dart:async";
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::_GrowableList::•<core::int>(0)))
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 'MyStream<dynamic>' can't be assigned to a variable of type 'List<int>'.
- 'MyStream' is from 'pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart'.
- 'List' is from 'dart:core'.
Try changing the type of the left hand side, or casting the right hand side to 'List<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:68: Error: A value of type 'List<dynamic>' can't be assigned to a variable of type 'Stream<List<int>>'.
- 'List' is from 'dart:core'.
- 'Stream' is from 'dart:async'.
Try changing the type of the left hand side, or casting the right hand side to 'Stream<List<int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic*/ List();
^" in core::_GrowableList::•<dynamic>(0) 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::Map::•<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 'List<dynamic>' can't be assigned to a variable of type 'Map<int, int>'.
- 'List' is from 'dart:core'.
- 'Map' is from 'dart:core'.
Try changing the type of the left hand side, or casting the right hand side to 'Map<int, 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:77: Error: A value of type 'Map<dynamic, dynamic>' can't be assigned to a variable of type 'Iterable<Map<int, int>>'.
- 'Map' is from 'dart:core'.
- 'Iterable' is from 'dart:core'.
Try changing the type of the left hand side, or casting the right hand side to 'Iterable<Map<int, int>>'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ new /*@typeArgs=dynamic, dynamic*/ Map();
^" in core::Map::•<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 {}