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

Side by Side Diff: pkg/front_end/testcases/inference/infer_type_on_var_from_field.dart

Issue 2933663002: Annotate targets of implicit this property gets/sets in inference tests. (Closed)
Patch Set: Created 3 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
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /*@testedFeatures=inference*/ 5 /*@testedFeatures=inference*/
6 library test; 6 library test;
7 7
8 class A { 8 class A {
9 int x = 0; 9 int x = 0;
10 10
11 test1() { 11 test1() {
12 var /*@type=int*/ a = x; 12 var /*@type=int*/ a = /*@target=A::x*/ x;
13 a = /*error:INVALID_ASSIGNMENT*/ "hi"; 13 a = /*error:INVALID_ASSIGNMENT*/ "hi";
14 a = 3; 14 a = 3;
15 var /*@type=int*/ b = y; 15 var /*@type=int*/ b = /*@target=A::y*/ y;
16 b = /*error:INVALID_ASSIGNMENT*/ "hi"; 16 b = /*error:INVALID_ASSIGNMENT*/ "hi";
17 b = 4; 17 b = 4;
18 var /*@type=int*/ c = z; 18 var /*@type=int*/ c = /*@target=A::z*/ z;
19 c = /*error:INVALID_ASSIGNMENT*/ "hi"; 19 c = /*error:INVALID_ASSIGNMENT*/ "hi";
20 c = 4; 20 c = 4;
21 } 21 }
22 22
23 int y; // field def after use 23 int y; // field def after use
24 final /*@topType=int*/ z = 42; // should infer `int` 24 final /*@topType=int*/ z = 42; // should infer `int`
25 } 25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698