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>
31 lines
1.6 KiB
Plaintext
31 lines
1.6 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue42089.dart:7:16: Error: A value of type 'X?' can't be assigned to a variable of type 'Object' because 'X?' is nullable and 'Object' isn't.
|
|
// - 'Object' is from 'dart:core'.
|
|
// Object o = x;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue42089.dart:8:9: Error: A value of type 'X?' can't be assigned to a variable of type 'Object' because 'X?' is nullable and 'Object' isn't.
|
|
// - 'Object' is from 'dart:core'.
|
|
// o = x;
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
static method test<X extends core::Object? = dynamic>(self::test::X? x) → dynamic {
|
|
if(x is{ForNonNullableByDefault} core::String?) {
|
|
core::Object o = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue42089.dart:7:16: Error: A value of type 'X?' can't be assigned to a variable of type 'Object' because 'X?' is nullable and 'Object' isn't.
|
|
- 'Object' is from 'dart:core'.
|
|
Object o = x;
|
|
^" in x{self::test::X? & core::String? /* '?' & '?' = '?' */} as{TypeError,ForNonNullableByDefault} core::Object;
|
|
o = let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue42089.dart:8:9: Error: A value of type 'X?' can't be assigned to a variable of type 'Object' because 'X?' is nullable and 'Object' isn't.
|
|
- 'Object' is from 'dart:core'.
|
|
o = x;
|
|
^" in x{self::test::X? & core::String? /* '?' & '?' = '?' */} as{TypeError,ForNonNullableByDefault} core::Object;
|
|
}
|
|
}
|
|
static method main() → dynamic {}
|