blob: afeab2269707b7db164fe14f9844d086970c34be [file] [log] [blame]
library test /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:69: 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'.
// yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@ typeArgs=dynamic */ MyStream();
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:64: 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'.
// yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:63: 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'.
// yield /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
// ^
//
// pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:79: 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'.
// 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 throw "";
}
static method foo() asy::Stream<core::List<core::int>> async* {
yield<core::int>[];
yield invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:16:69: 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'.
yield /*error:YIELD_OF_INVALID_TYPE*/ new /*@ typeArgs=dynamic */ MyStream();
^" in self::MyStream::•<dynamic>() as{TypeError,ForNonNullableByDefault} core::List<core::int>;
yield* invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:17:64: 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'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
^" in <dynamic>[] as{TypeError,ForNonNullableByDefault} asy::Stream<core::List<core::int>>;
yield* self::MyStream::•<core::List<core::int>>();
}
static method bar() core::Iterable<core::Map<core::int, core::int>> sync* {
yield core::Map::•<core::int, core::int>();
yield invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:23:63: 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'.
yield /*error:YIELD_OF_INVALID_TYPE*/ /*@typeArgs=dynamic*/ [];
^" in <dynamic>[] as{TypeError,ForNonNullableByDefault} core::Map<core::int, core::int>;
yield* invalid-expression "pkg/front_end/testcases/inference/downwards_inference_yield_yield_star.dart:24:79: 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'.
yield* /*error:YIELD_OF_INVALID_TYPE*/ new /*@ typeArgs=dynamic, dynamic */ Map();
^" in core::Map::•<dynamic, dynamic>() as{TypeError,ForNonNullableByDefault} core::Iterable<core::Map<core::int, core::int>>;
yield*<core::Map<core::int, core::int>>[];
}
static method main() dynamic {}