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 "dart:mirrors"; | 5 import "dart:mirrors"; |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 class A { | 8 class A { |
9 A(); | 9 A(); |
10 factory A.circular() = B.circular; | 10 factory A.circular() = B.circular; |
11 const factory A.circular2() = B.circular2; | 11 const factory A.circular2() = B.circular2; |
12 } | 12 } |
| 13 |
13 class B implements A { | 14 class B implements A { |
14 B(); | 15 B(); |
15 factory B.circular() = C.circular; | 16 factory B.circular() = C.circular; |
16 const factory B.circular2() = C.circular2; | 17 const factory B.circular2() = C.circular2; |
17 } | 18 } |
| 19 |
18 class C implements B { | 20 class C implements B { |
19 const C(); | 21 const C(); |
20 factory C.circular() | 22 factory C.circular() |
21 /* //# 01: compile-time error | 23 /* //# 01: compile-time error |
22 = C; | 24 = C; |
23 */ = A.circular; //# 01: continued | 25 */ = A.circular; //# 01: continued |
24 | 26 |
25 const factory C.circular2() | 27 const factory C.circular2() |
26 /* //# 02: compile-time error | 28 /* //# 02: compile-time error |
27 = C; | 29 = C; |
28 */ = A.circular2; //# 02: continued | 30 */ = A.circular2; //# 02: continued |
29 } | 31 } |
30 | 32 |
31 main() { | 33 main() { |
32 ClassMirror cm = reflectClass(A); | 34 ClassMirror cm = reflectClass(A); |
33 | 35 |
34 new A.circular(); | 36 new A.circular(); |
35 new A.circular2(); | 37 new A.circular2(); |
36 } | 38 } |
OLD | NEW |