OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Check that the implicit super call for synthetic constructors are checked. | 5 // Check that the implicit super call for synthetic constructors are checked. |
6 | 6 |
7 | 7 |
8 class A { | 8 class A { |
9 final x; | 9 final x; |
10 A(this.x); | 10 A(this.x); |
11 } | 11 } |
12 | 12 |
13 class B extends A { | 13 class B extends A { |
14 /* /// 00: compile-time error | 14 /* // /// 00: compile-time error |
15 B() : super(null); | 15 B() : super(null); |
16 */ /// 00: continued | 16 */ // /// 00: continued |
17 } | 17 } |
18 | 18 |
19 // ========== | 19 // ========== |
20 | 20 |
21 class Y extends A { | 21 class Y extends A { |
22 /* /// 01: compile-time error | 22 /* // /// 01: compile-time error |
23 Y() : super(null); | 23 Y() : super(null); |
24 */ /// 01: continued | 24 */ // /// 01: continued |
25 } | 25 } |
26 | 26 |
27 class Z extends Y { | 27 class Z extends Y { |
28 Z() : super(); | 28 Z() : super(); |
29 } | 29 } |
30 | 30 |
31 // ============== | 31 // ============== |
32 | 32 |
33 class G extends A { | 33 class G extends A { |
34 /* /// 02: compile-time error | 34 /* // /// 02: compile-time error |
35 G() : super(null); | 35 G() : super(null); |
36 */ /// 02: continued | 36 */ // /// 02: continued |
37 } | 37 } |
38 | 38 |
39 class H extends G { | 39 class H extends G { |
40 } | 40 } |
41 | 41 |
42 main() { | 42 main() { |
43 new B().x; | 43 new B().x; |
44 new Z().x; | 44 new Z().x; |
45 new H().x; | 45 new H().x; |
46 } | 46 } |
OLD | NEW |