dart-sdk/tests/dart2js/mixin_subtype_test.dart
Joshua Litt f9f1ca6171 [dart2js] Create tests/dart2js for nnbd.
Change-Id: Ib8721cf976803d8d1b9d723b7e691e344c768b67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/149881
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Joshua Litt <joshualitt@google.com>
2020-06-09 16:53:15 +00:00

54 lines
954 B
Dart

// Copyright (c) 2018, 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.
import "package:expect/expect.dart";
class A {}
class B {}
class I {}
class J {}
mixin M1 on A, B implements I, J {}
class M2 implements A, B, I, J {}
class M3 implements A, B, I, J {}
class M4 implements A, B, I, J {}
class M5 implements A, B, I, J {}
class C implements A, B {}
class D1 = C with M1;
class D2 = C with M2;
class D3 = C with M3;
class D4 extends C with M4 {}
class D5 extends C with M5 {}
class E5 extends D5 {}
@pragma('dart2js:noInline')
test(o) {}
main() {
test(new M3());
test(new D2());
test(new D4());
test(new E5());
Expect.subtype<D1, M1>();
Expect.subtype<D2, M2>();
Expect.subtype<D3, M3>();
Expect.subtype<D4, M4>();
Expect.subtype<D5, M5>();
Expect.subtype<E5, M5>();
}