Files
sdk/pkg/front_end/testcases/nnbd_mixed/issue41657.dart.weak.expect
T
Dmitry Stefantsov c1a401c5da [cfe] Implement weak mode constant canonicalization update
Closes #44641.
Closes #44246.

Bug: https://github.com/dart-lang/sdk/issues/44641
Bug: https://github.com/dart-lang/sdk/issues/44246
Change-Id: I78cb0514a57ab3adafb3639b09ea8930791da030
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179340
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-01-22 12:06:49 +00:00

29 lines
1.2 KiB
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
static final field core::bool isLegacySubtyping1a = (#C1) is{ForNonNullableByDefault} core::List<core::int>;
static const field core::bool isLegacySubtyping1b = #C2;
static final field core::bool isLegacySubtyping2a = (#C3) is{ForNonNullableByDefault} core::List<core::int>;
static const field core::bool isLegacySubtyping2b = #C2;
static final field core::List<core::int> assertLegacySubtyping1a = (#C1) as{ForNonNullableByDefault} core::List<core::int>;
static const field core::List<core::int> assertLegacySubtyping1b = #C1;
static final field core::List<core::int> assertLegacySubtyping2a = (#C3) as{ForNonNullableByDefault} core::List<core::int>;
static const field core::List<core::int> assertLegacySubtyping2b = #C3;
static method main() → void {
self::expect(self::isLegacySubtyping1a, #C2);
self::expect(self::isLegacySubtyping2a, #C2);
self::expect(self::assertLegacySubtyping1a, #C1);
self::expect(self::assertLegacySubtyping2a, #C3);
}
static method expect(dynamic expected, dynamic actual) → dynamic {
if(!expected.{core::Object::==}(actual))
throw "Expected ${expected}, actual ${actual}";
}
constants {
#C1 = <Null>[]
#C2 = true
#C3 = <core::int?>[]
}