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

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

Issue 1173523002: Fix analyzer's handling of import prefixes not followed by '.'. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « tests/language/conditional_property_access_test.dart ('k') | tests/language/empty_library.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 semantics of the ?. operator when it appears on the LHS of an 5 // Verify semantics of the ?. operator when it appears on the LHS of an
6 // assignment. 6 // assignment.
7 7
8 // SharedOptions=--enable-null-aware-operators 8 // SharedOptions=--enable-null-aware-operators
9 9
10 import "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // classes. 80 // classes.
81 Expect.throws(() => C?.staticField = null, noMethod); /// 14: static type warn ing 81 Expect.throws(() => C?.staticField = null, noMethod); /// 14: static type warn ing
82 Expect.throws(() => C?.staticField += null, noMethod); /// 15: static type war ning 82 Expect.throws(() => C?.staticField += null, noMethod); /// 15: static type war ning
83 Expect.throws(() => C?.staticField ??= null, noMethod); /// 16: static type wa rning 83 Expect.throws(() => C?.staticField ??= null, noMethod); /// 16: static type wa rning
84 Expect.throws(() => h.C?.staticField = null, noMethod); /// 17: static type wa rning 84 Expect.throws(() => h.C?.staticField = null, noMethod); /// 17: static type wa rning
85 Expect.throws(() => h.C?.staticField += null, noMethod); /// 18: static type w arning 85 Expect.throws(() => h.C?.staticField += null, noMethod); /// 18: static type w arning
86 Expect.throws(() => h.C?.staticField ??= null, noMethod); /// 19: static type warning 86 Expect.throws(() => h.C?.staticField ??= null, noMethod); /// 19: static type warning
87 87
88 // Nor can it be used to assign to toplevel properties in libraries imported 88 // Nor can it be used to assign to toplevel properties in libraries imported
89 // via prefix. 89 // via prefix.
90 Expect.throws(() => h?.topLevelVar = null, noMethod); /// 20: static type warn ing 90 h?.topLevelVar = null; /// 20: compile-time error
91 Expect.throws(() => h?.topLevelVar += null, noMethod); /// 21: static type war ning 91 h?.topLevelVar += null; /// 21: compile-time error
92 Expect.throws(() => h?.topLevelVar ??= null, noMethod); /// 22: static type wa rning 92 h?.topLevelVar ??= null; /// 22: compile-time error
93 } 93 }
OLDNEW
« no previous file with comments | « tests/language/conditional_property_access_test.dart ('k') | tests/language/empty_library.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698