dart-sdk/tests/web_2/mixin_subtype_test.dart
Sigmund Cherem 912005267d [web] rename suite dart2js -> web.
Change-Id: I46be49b2effec3e38a3dc44cd45cfe736f77fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182680
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-02-04 23:11:32 +00:00

56 lines
970 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.
// @dart = 2.7
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>();
}