Files
sdk/pkg/front_end/testcases/nnbd_mixed/const_is.dart.weak.expect
T
Johnni Winther fdc765faad [cfe] Make TypeParameter.defaultType non-nullable
TEST=existing

Change-Id: I0a8fdf09f742b55357411f12dc6164d4050bb83c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196283
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-04-21 13:51:50 +00:00

34 lines
1.1 KiB
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
import "org-dartlang-testcase:///const_is_lib.dart";
static method main() → dynamic {
self::expect(true, (#C1) is{ForNonNullableByDefault} <T extends core::Object?>() → void);
self::expect(true, #C2);
self::expect(true, (#C3) is{ForNonNullableByDefault} <T extends Never = dynamic>() → void);
self::expect(true, #C2);
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
library /*isNonNullableByDefault*/;
import self as self2;
import "dart:core" as core;
typedef fnTypeWithNullableObjectBound = <T extends core::Object?>() → void;
typedef fnTypeWithNeverBound = <T extends Never = dynamic>() → void;
static method fnWithNonNullObjectBound<T extends core::Object>() → void
return null;
static method fnWithNullBound<T extends Null>() → void
return null;
constants {
#C1 = tearoff self2::fnWithNonNullObjectBound
#C2 = true
#C3 = tearoff self2::fnWithNullBound
}