OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 abstract class Mixin1<T> { | 7 abstract class Mixin1<T> {} |
8 } | |
9 | 8 |
10 abstract class Mixin2<T> { | 9 abstract class Mixin2<T> {} |
11 } | |
12 | 10 |
13 class A { | 11 class A { |
14 A(foo); | 12 A(foo); |
15 } | 13 } |
16 | 14 |
17 class B<K, V> extends A with Mixin1<K>, Mixin2<V> { | 15 class B<K, V> extends A with Mixin1<K>, Mixin2<V> { |
18 B(foo) : super(foo); | 16 B(foo) : super(foo); |
19 } | 17 } |
20 | 18 |
21 main() { | 19 main() { |
22 var b = new B<num, String>(null); | 20 var b = new B<num, String>(null); |
23 Expect.isTrue(b is Mixin1<num>); | 21 Expect.isTrue(b is Mixin1<num>); |
24 Expect.isTrue(b is! Mixin1<String>); | 22 Expect.isTrue(b is! Mixin1<String>); |
25 Expect.isTrue(b is Mixin2<String>); | 23 Expect.isTrue(b is Mixin2<String>); |
26 Expect.isTrue(b is! Mixin2<num>); | 24 Expect.isTrue(b is! Mixin2<num>); |
27 } | 25 } |
OLD | NEW |