OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 class C1 { | 5 class C1 {} |
6 } | |
7 | 6 |
8 class C2 { | 7 class C2 {} |
9 } | |
10 | 8 |
11 class C3 { | 9 class C3 {} |
12 } | |
13 | 10 |
14 class A<T> { | 11 class A<T> { |
15 A.internal(); | 12 A.internal(); |
16 | 13 |
17 factory A.a() = B<T>.a; | 14 factory A.a() = B<T>.a; |
18 factory A.b() = B<C1>.a; | 15 factory A.b() = B<C1>.a; |
19 factory A.c() = Missing; | 16 factory A.c() = Missing; |
20 } | 17 } |
21 | 18 |
22 class B<S> extends A<S> { | 19 class B<S> extends A<S> { |
23 B.internal() | 20 B.internal() : super.internal(); |
24 : super.internal(); | |
25 | 21 |
26 factory B.a() = C<S>; | 22 factory B.a() = C<S>; |
27 factory B.b() = C<C2>; | 23 factory B.b() = C<C2>; |
28 } | 24 } |
29 | 25 |
30 class C<U> extends B<U> { | 26 class C<U> extends B<U> { |
31 C() | 27 C() : super.internal(); |
32 : super.internal(); | |
33 } | 28 } |
34 | 29 |
35 main() { | 30 main() { |
36 new A<C3>.a(); | 31 new A<C3>.a(); |
37 new A<C3>.b(); | 32 new A<C3>.b(); |
38 new B<C3>.a(); | 33 new B<C3>.a(); |
39 new B<C3>.b(); | 34 new B<C3>.b(); |
40 new A<C3>.c(); | 35 new A<C3>.c(); |
41 } | 36 } |
OLD | NEW |