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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 import "deferred_inheritance_constraints_lib.dart" deferred as lib; | 6 import "deferred_inheritance_constraints_lib.dart" deferred as lib; |
7 | 7 |
8 class Foo {} | 8 class Foo {} |
| 9 class Foo2 extends D {} |
| 10 |
| 11 class A extends |
| 12 lib. //# extends: compile-time error |
| 13 Foo {} |
| 14 class B implements |
| 15 lib. //# implements: compile-time error |
| 16 Foo {} |
| 17 class C1 {} |
| 18 class C = C1 with |
| 19 lib. //# mixin: compile-time error |
| 20 Foo; |
9 | 21 |
10 class Foo2 extends D {} | 22 class D { |
11 | 23 D() ; |
12 class A extends | 24 factory D.factory() = |
13 lib. //# extends: compile-time error | |
14 Foo {} | |
15 | |
16 class B | |
17 implements | |
18 lib. //# implements: compile-time error | |
19 Foo {} | |
20 | |
21 class C1 {} | |
22 | |
23 class C = C1 | |
24 with | |
25 lib. //# mixin: compile-time error | |
26 Foo; | |
27 | |
28 class D { | |
29 D(); | |
30 factory D.factory() = | |
31 lib. //# redirecting_constructor: static type warning | 25 lib. //# redirecting_constructor: static type warning |
32 Foo2; | 26 Foo2; |
33 } | 27 } |
34 | 28 |
35 void main() { | 29 void main() { |
36 new A(); | 30 new A(); |
37 new B(); | 31 new B(); |
38 new C(); | 32 new C(); |
39 Expect.throws(() { //# redirecting_constructor: continued | 33 Expect.throws(() { //# redirecting_constructor: continued |
40 new D.factory(); | 34 new D.factory(); |
41 }); //# redirecting_constructor: continued | 35 }); //# redirecting_constructor: continued |
42 } | 36 } |
OLD | NEW |