| 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 M<T> { | 7 class M<T> { |
| 8 t() { return T; } | 8 t() { return T; } |
| 9 } | 9 } |
| 10 | 10 |
| 11 typedef A<U> = Object with M<List<U>>; | 11 class A<U> = Object with M<List<U>>; |
| 12 | 12 |
| 13 typedef B0 = Object with A<Set<bool>>; | 13 class B0 = Object with A<Set<bool>>; |
| 14 | 14 |
| 15 typedef B1 = Object with A<Set<int>>; | 15 class B1 = Object with A<Set<int>>; |
| 16 | 16 |
| 17 class C0 extends B0 { } | 17 class C0 extends B0 { } |
| 18 | 18 |
| 19 class C1 extends B1 { } | 19 class C1 extends B1 { } |
| 20 | 20 |
| 21 typedef A2<K, V> = Object with M<Map<K, V>>; | 21 class A2<K, V> = Object with M<Map<K, V>>; |
| 22 | 22 |
| 23 typedef B2<V> = Object with A2<Set<V>, List<V>>; | 23 class B2<V> = Object with A2<Set<V>, List<V>>; |
| 24 | 24 |
| 25 typedef B3<K, V> = Object with A2<Set<K>, List<V>>; | 25 class B3<K, V> = Object with A2<Set<K>, List<V>>; |
| 26 | 26 |
| 27 class C2<T> extends B2<T> { } | 27 class C2<T> extends B2<T> { } |
| 28 | 28 |
| 29 class C3<T> extends B3<T, int> { } | 29 class C3<T> extends B3<T, int> { } |
| 30 | 30 |
| 31 class N { | 31 class N { |
| 32 q() { return 42; } | 32 q() { return 42; } |
| 33 } | 33 } |
| 34 | 34 |
| 35 typedef O<U> = Object with N; | 35 class O<U> = Object with N; |
| 36 | 36 |
| 37 typedef P<K, V> = Object with O<V>; | 37 class P<K, V> = Object with O<V>; |
| 38 | 38 |
| 39 class Q<K, V> extends P<K, V> { } | 39 class Q<K, V> extends P<K, V> { } |
| 40 | 40 |
| 41 main() { | 41 main() { |
| 42 Expect.equals("List<Set<bool>>", new C0().t().toString()); | 42 Expect.equals("List<Set<bool>>", new C0().t().toString()); |
| 43 Expect.equals("List<Set<int>>", new C1().t().toString()); | 43 Expect.equals("List<Set<int>>", new C1().t().toString()); |
| 44 Expect.equals("Map<Set<bool>, List<bool>>", new C2<bool>().t().toString()); | 44 Expect.equals("Map<Set<bool>, List<bool>>", new C2<bool>().t().toString()); |
| 45 Expect.equals("Map<Set<bool>, List<int>>", new C3<bool>().t().toString()); | 45 Expect.equals("Map<Set<bool>, List<int>>", new C3<bool>().t().toString()); |
| 46 Expect.equals(42, new Q<bool, int>().q()); | 46 Expect.equals(42, new Q<bool, int>().q()); |
| 47 } | 47 } |
| OLD | NEW |