Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Side by Side Diff: tests/language/super_conditional_operator_test.dart

Issue 1239513005: Switch on null-aware operators by default in analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « tests/language/nullaware_opt_test.dart ('k') | tests/language/this_conditional_operator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698