Files
sdk/pkg/front_end/testcases/nnbd/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

22 lines
862 B
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 = <Null>[] is List<int>;
const isLegacySubtyping1b = <Null>[] is List<int>;
final isLegacySubtyping2a = <int?>[] is List<int>;
const isLegacySubtyping2b = <int?>[] is List<int>;
//final assertLegacySubtyping2 = <Null>[] as List<int>;
const assertLegacySubtyping1 = <Null>[] as List<int>;
//final assertLegacySubtyping2 = <int?>[] as List<int>;
const assertLegacySubtyping2 = <int?>[] as List<int>;
void main() {
expect(isLegacySubtyping1a, isLegacySubtyping1b);
expect(isLegacySubtyping2a, isLegacySubtyping2b);
}
expect(expected, actual) {
if (expected != actual) throw "Expected $expected, actual $actual";
}