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 // Verify that when no constructors are forwarded from the base class | 5 // Verify that when no constructors are forwarded from the base class |
6 // through a mixin, it is always an error; the mixin does not acquire an | 6 // through a mixin, it is always an error; the mixin does not acquire an |
7 // implicit default constructor. | 7 // implicit default constructor. |
8 | 8 |
9 abstract class Mixin {} | 9 abstract class Mixin {} |
10 | 10 |
11 class Base { | 11 class Base { |
12 Base( | 12 Base( |
13 {x} /// 01: compile-time error | 13 {x} //# 01: compile-time error |
14 {x} /// 02: compile-time error | 14 {x} //# 02: compile-time error |
15 {x} /// 03: compile-time error | 15 {x} //# 03: compile-time error |
16 ); | 16 ); |
17 } | 17 } |
18 | 18 |
19 class C extends Base with Mixin { | 19 class C extends Base with Mixin { |
20 C(); /// 02: continued | 20 C(); //# 02: continued |
21 C() : super(); /// 03: continued | 21 C() : super(); //# 03: continued |
22 } | 22 } |
23 | 23 |
24 main() { | 24 main() { |
25 new C(); | 25 new C(); |
26 } | 26 } |
OLD | NEW |