Files
sdk/pkg/front_end/testcases/nnbd_mixed/issue41657.dart
T
Johnni Winther 6336e8e2d3 [cfe] Use legacy subtyping in weak mode constant evaluation.
+ add checks for agnostic subtyping differences

Closes #41657

Change-Id: I1e6b558edbfcb1ca282e0e4c788c6a7a7db6bfd3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148126
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-05-19 08:55:20 +00:00

24 lines
1.0 KiB
Dart

// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
final isLegacySubtyping1a = const <Null>[] is List<int>;
const isLegacySubtyping1b = const <Null>[] is List<int>;
final isLegacySubtyping2a = const <int?>[] is List<int>;
const isLegacySubtyping2b = const <int?>[] is List<int>;
final assertLegacySubtyping1a = const <Null>[] as List<int>;
const assertLegacySubtyping1b = const <Null>[] as List<int>;
final assertLegacySubtyping2a = const <int?>[] as List<int>;
const assertLegacySubtyping2b = const <int?>[] as List<int>;
void main() {
expect(isLegacySubtyping1a, isLegacySubtyping1b);
expect(isLegacySubtyping2a, isLegacySubtyping2b);
expect(assertLegacySubtyping1a, assertLegacySubtyping1b);
expect(assertLegacySubtyping2a, assertLegacySubtyping2b);
}
expect(expected, actual) {
if (expected != actual) throw "Expected $expected, actual $actual";
}