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 class I<T> { } | 7 class I<T> {} |
8 | 8 |
9 class J<T> { } | 9 class J<T> {} |
10 | 10 |
11 class S<T> { } | 11 class S<T> {} |
12 | 12 |
13 class M<T> { | 13 class M<T> { |
14 t() { return T; } | 14 t() { |
| 15 return T; |
| 16 } |
15 } | 17 } |
16 | 18 |
17 class A<U, V> = Object with M<Map<U, V>> implements I<V>; | 19 class A<U, V> = Object with M<Map<U, V>> implements I<V>; |
18 | 20 |
19 class C<T, K> = S<T> with A<T, List<K>> implements J<K>; | 21 class C<T, K> = S<T> with A<T, List<K>> implements J<K>; |
20 | 22 |
21 main() { | 23 main() { |
22 var c = new C<int, bool>(); | 24 var c = new C<int, bool>(); |
23 Expect.equals("Map<int, List<bool>>", c.t().toString()); | 25 Expect.equals("Map<int, List<bool>>", c.t().toString()); |
24 Expect.isTrue(c is I<List<bool>>); | 26 Expect.isTrue(c is I<List<bool>>); |
25 Expect.isTrue(c is J<bool>); | 27 Expect.isTrue(c is J<bool>); |
26 Expect.isTrue(c is S<int>); | 28 Expect.isTrue(c is S<int>); |
27 Expect.isTrue(c is A<int, List<bool>>); | 29 Expect.isTrue(c is A<int, List<bool>>); |
28 Expect.isTrue(c is M<Map<int, List<bool>>>); | 30 Expect.isTrue(c is M<Map<int, List<bool>>>); |
29 } | 31 } |
OLD | NEW |