OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library lib; | |
6 | |
7 @MirrorsUsed(targets: "lib") | |
8 import "dart:mirrors"; | |
9 import "package:expect/expect.dart"; | |
10 | |
11 class A { | |
12 A(); | |
13 factory A.circular() = B.circular; | |
14 const factory A.circular2() = B.circular2; | |
15 } | |
16 | |
17 class B implements A { | |
18 B(); | |
19 factory B.circular() = C.circular; | |
20 const factory B.circular2() = C.circular2; | |
21 } | |
22 | |
23 class C implements B { | |
24 const C(); | |
25 factory C.circular() | |
26 /* //# 01: compile-time error | |
27 = C; | |
28 */ = A.circular; //# 01: continued | |
29 | |
30 const factory C.circular2() | |
31 /* //# 02: compile-time error | |
32 = C; | |
33 */ = A.circular2; //# 02: continued | |
34 } | |
35 | |
36 main() { | |
37 ClassMirror cm = reflectClass(A); | |
38 | |
39 new A.circular(); | |
40 new A.circular2(); | |
41 } | |
OLD | NEW |