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 // Verify that the ?. operator cannot be used with "super". | 5 // Verify that the ?. operator cannot be used with "super". |
6 | 6 |
7 // SharedOptions=--enable-null-aware-operators | |
8 | |
9 class B { | 7 class B { |
10 B(); | 8 B(); |
11 B.namedConstructor(); | 9 B.namedConstructor(); |
12 var field = 1; | 10 var field = 1; |
13 method() => 1; | 11 method() => 1; |
14 } | 12 } |
15 | 13 |
16 class C extends B { | 14 class C extends B { |
17 C() | 15 C() |
18 : super?.namedConstructor() /// 01: compile-time error | 16 : super?.namedConstructor() /// 01: compile-time error |
(...skipping 16 matching lines...) Expand all Loading... |
35 ~super?.method(); /// 15: compile-time error | 33 ~super?.method(); /// 15: compile-time error |
36 !super?.method(); /// 16: compile-time error | 34 !super?.method(); /// 16: compile-time error |
37 --super?.method(); /// 17: compile-time error | 35 --super?.method(); /// 17: compile-time error |
38 ++super?.method(); /// 18: compile-time error | 36 ++super?.method(); /// 18: compile-time error |
39 } | 37 } |
40 } | 38 } |
41 | 39 |
42 main() { | 40 main() { |
43 new C().test(); | 41 new C().test(); |
44 } | 42 } |
OLD | NEW |