c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
300 lines
15 KiB
Plaintext
300 lines
15 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:21:10: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// yield* getIterableNull(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// Iterable<bool> test5() => getIterableNull(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:38:12: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// yield* getIterableNull(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// Iterable<bool> test5() => getIterableNull(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:49:5: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// })(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:54:5: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// })(); // error
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41437b.dart:55:50: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
// - 'Iterable' is from 'dart:core'.
|
|
// Iterable<bool> var5 = (() => getIterableNull())(); // error
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:async" as asy;
|
|
|
|
static method getNull() → dynamic
|
|
return null;
|
|
static method getIterableNull() → core::Iterable<dynamic> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_current} = null;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<dynamic>(:sync_op_gen);
|
|
}
|
|
static method getIterableBool() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_current} = true;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
static method test1() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_current} = self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
static method test2() → core::Iterable<core::bool>
|
|
return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
static method test3() → core::bool
|
|
return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
|
|
static method test4() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:21:10: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
yield* getIterableNull(); // error
|
|
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
static method test5() → core::Iterable<core::bool>
|
|
return let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:24:27: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
Iterable<bool> test5() => getIterableNull(); // error
|
|
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
static method test6() → core::Iterable<core::bool>
|
|
return self::getIterableBool();
|
|
static method test7() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = self::getIterableBool();
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
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;
|
|
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
|
|
try {
|
|
#L1:
|
|
{
|
|
function test1() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_current} = self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
function test2() → core::Iterable<core::bool>
|
|
return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
function test3() → core::bool
|
|
return self::getNull() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
|
|
function test4() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = let final Never #t3 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:38:12: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
yield* getIterableNull(); // error
|
|
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
function test5() → core::Iterable<core::bool>
|
|
return let final Never #t4 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:41:29: Error: A value of type 'Iterable<dynamic>' can't be returned from a function with return type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
Iterable<bool> test5() => getIterableNull(); // error
|
|
^" in self::getIterableNull() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
function test6() → core::Iterable<core::bool>
|
|
return self::getIterableBool();
|
|
function test7() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = self::getIterableBool();
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}
|
|
core::Iterable<core::bool> var1 = let final Never #t5 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:49:5: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
})(); // error
|
|
^" in (() → core::Iterable<dynamic> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_current} = self::getNull();
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<dynamic>(:sync_op_gen);
|
|
}).call() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
core::Iterable<core::bool> var2 = (() → dynamic => self::getNull()).call() as{TypeError,ForDynamic,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
core::bool var3 = (() → dynamic => self::getNull()).call() as{TypeError,ForDynamic,ForNonNullableByDefault} core::bool;
|
|
core::Iterable<core::bool> var4 = let final Never #t6 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:54:5: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
})(); // error
|
|
^" in (() → core::Iterable<dynamic> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = self::getIterableNull();
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<dynamic>(:sync_op_gen);
|
|
}).call() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
core::Iterable<core::bool> var5 = let final Never #t7 = invalid-expression "pkg/front_end/testcases/nnbd/issue41437b.dart:55:50: Error: A value of type 'Iterable<dynamic>' can't be assigned to a variable of type 'Iterable<bool>'.
|
|
- 'Iterable' is from 'dart:core'.
|
|
Iterable<bool> var5 = (() => getIterableNull())(); // error
|
|
^" in (() → core::Iterable<dynamic> => self::getIterableNull()).call() as{TypeError,ForNonNullableByDefault} core::Iterable<core::bool>;
|
|
core::Iterable<core::bool> var6 = (() → core::Iterable<core::bool> => self::getIterableBool()).call();
|
|
core::Iterable<core::bool> var7 = (() → core::Iterable<core::bool> /* originally sync* */ {
|
|
function :sync_op_gen() → (core::_SyncIterator<dynamic>?, dynamic, dynamic) → core::bool* {
|
|
core::int :await_jump_var = 0;
|
|
dynamic :await_ctx_var;
|
|
function :sync_op(core::_SyncIterator<dynamic>? :iterator, dynamic :exception, dynamic :stack_trace) → core::bool* yielding {
|
|
{
|
|
{
|
|
:iterator.{core::_SyncIterator::_yieldEachIterable} = self::getIterableBool();
|
|
[yield] true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
return :sync_op;
|
|
}
|
|
return new core::_SyncIterable::•<core::bool>(:sync_op_gen);
|
|
}).call();
|
|
}
|
|
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 {}
|