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

Side by Side Diff: test/codegen/language/super_conditional_operator_test.dart

Issue 1316723003: implement null aware ops, fixes #249 (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 4 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
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Verify that the ?. operator cannot be used with "super".
6
7 class B {
8 B();
9 B.namedConstructor();
10 var field = 1;
11 method() => 1;
12 }
13
14 class C extends B {
15 C()
16 : super?.namedConstructor() /// 01: compile-time error
17 ;
18
19 test() {
20 super?.field = 1; /// 02: compile-time error
21 super?.field += 1; /// 03: compile-time error
22 super?.field ??= 1; /// 04: compile-time error
23 super?.field; /// 05: compile-time error
24 1 * super?.field; /// 06: compile-time error
25 -super?.field; /// 07: compile-time error
26 ~super?.field; /// 08: compile-time error
27 !super?.field; /// 09: compile-time error
28 --super?.field; /// 10: compile-time error
29 ++super?.field; /// 11: compile-time error
30 super?.method(); /// 12: compile-time error
31 1 * super?.method(); /// 13: compile-time error
32 -super?.method(); /// 14: compile-time error
33 ~super?.method(); /// 15: compile-time error
34 !super?.method(); /// 16: compile-time error
35 --super?.method(); /// 17: compile-time error
36 ++super?.method(); /// 18: compile-time error
37 }
38 }
39
40 main() {
41 new C().test();
42 }
OLDNEW
« no previous file with comments | « test/codegen/language/nullaware_opt_test.dart ('k') | test/codegen/language/this_conditional_operator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698