OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // Regression test for http://dartbug.com/23486/ | 5 // Regression test for http://dartbug.com/23486/ |
6 // | 6 // |
7 // Dart2js used to crash when using `super` and prefixes inside parenthesized | 7 // Dart2js used to crash when using `super` and prefixes inside parenthesized |
8 // expressions. | 8 // expressions. |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 | 10 |
11 import '23486_helper.dart' as p; | 11 import '23486_helper.dart' as p; |
12 | 12 |
13 class B { | 13 class B { |
14 var field = 1; | 14 var field = 1; |
15 } | 15 } |
16 | 16 |
17 class A extends B { | 17 class A extends B { |
18 m() { | 18 m() { |
19 (super).field = 1; /// 01: compile-time error | 19 (super).field = 1; //# 01: compile-time error |
20 } | 20 } |
21 } | 21 } |
22 | 22 |
23 class C { | 23 class C { |
24 C(); | 24 C(); |
25 C.name(); | 25 C.name(); |
26 } | 26 } |
27 | 27 |
28 class D extends C { | 28 class D extends C { |
29 D() : super(); | 29 D() : super(); |
30 D.name() : (super).name(); /// 02: compile-time error | 30 D.name() : (super).name(); //# 02: compile-time error |
31 } | 31 } |
32 | 32 |
33 main() { | 33 main() { |
34 Expect.throws(new A().m); // /// 01: continued | 34 Expect.throws(new A().m); // //# 01: continued |
35 Expect.throws(() => new D.name()); /// 02: continued | 35 Expect.throws(() => new D.name()); //# 02: continued |
36 Expect.throws(() => (p).x); // /// 03: compile-time error | 36 Expect.throws(() => (p).x); // //# 03: compile-time error |
37 } | 37 } |
38 | 38 |
OLD | NEW |