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

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

Issue 2990773002: Migrate language/arithmetic2_test ... language/async_await_syntax_test. (Closed)
Patch Set: Update migrated tests and statuses to Dart 2.0. Created 3 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
« no previous file with comments | « tests/language/assign_top_method_test.dart ('k') | tests/language/async_and_or_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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 // Test to detect syntactically illegal left-hand-side (assignable)
6 // expressions.
7
8 class C {
9 static var static_field = 0;
10 }
11
12 var tl_static_var = 0;
13
14 main() {
15 tl_static_var = 0;
16 (tl_static_var) = 0; // //# 01: compile-time error
17 (tl_static_var)++; // //# 02: compile-time error
18 ++(tl_static_var); // //# 03: compile-time error
19
20 C.static_field = 0;
21 (C.static_field) = 0; // //# 11: compile-time error
22 (C.static_field)++; // //# 12: compile-time error
23 ++(C.static_field); // //# 13: compile-time error
24
25 tl_static_var = [1, 2, 3];
26 tl_static_var[0] = 0;
27 (tl_static_var)[0] = 0;
28 (tl_static_var[0]) = 0; // //# 21: compile-time error
29 (tl_static_var[0])++; // //# 22: compile-time error
30 ++(tl_static_var[0]); // //# 23: compile-time error
31
32 C.static_field = [1, 2, 3];
33 (C.static_field[0]) = 0; // //# 31: compile-time error
34 (C.static_field[0])++; // //# 32: compile-time error
35 ++(C.static_field[0]); // //# 33: compile-time error
36
37 var a = 0;
38 (a) = 0; // //# 41: compile-time error
39 (a)++; // //# 42: compile-time error
40 ++(a); // //# 43: compile-time error
41
42 // Neat palindrome expression. x is assignable, ((x)) is not.
43 var funcnuf = (x) => ((x))=((x)) <= (x); // //# 50: compile-time error
44 }
OLDNEW
« no previous file with comments | « tests/language/assign_top_method_test.dart ('k') | tests/language/async_and_or_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698