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

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

Issue 10837359: Language tests updated to use const instead of final. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 // This test insures that statically initialized variables, fields, and paramete rs 5 // This test insures that statically initialized variables, fields, and paramete rs
6 // report static type warnings. 6 // report static type warnings.
7 7
8 int a = "String"; /// 01: static type warning, dynamic type error 8 int a = "String"; /// 01: static type warning, dynamic type error
9 9
10 class A { 10 class A {
11 static final int c = "String"; /// 02: static type warning, dynamic type error 11 static const int c = "String"; /// 02: static type warning, dynamic type error
12 final int d = "String"; /// 03: static type warning, dynamic type error 12 final int d = "String"; /// 03: static type warning, dynamic type error
13 int e = "String"; /// 04: static type warning, dynamic type error 13 int e = "String"; /// 04: static type warning, dynamic type error
14 A() { 14 A() {
15 int f = "String"; /// 05: static type warning, dynamic type error 15 int f = "String"; /// 05: static type warning, dynamic type error
16 } 16 }
17 method([ 17 method([
18 int /// 06: static type warning 18 int /// 06: static type warning
19 g = "String"]) { 19 g = "String"]) {
20 return g; 20 return g;
21 } 21 }
22 } 22 }
23 23
24 int main() { 24 int main() {
25 var w = a; /// 01: continued 25 var w = a; /// 01: continued
26 var x; 26 var x;
27 x = A.c; /// 02: continued 27 x = A.c; /// 02: continued
28 var v = new A(); 28 var v = new A();
29 x = v.d; /// 03: continued 29 x = v.d; /// 03: continued
30 x = v.e; /// 04: continued 30 x = v.e; /// 04: continued
31 x = v.method(1); /// 06: continued 31 x = v.method(1); /// 06: continued
32 } 32 }
OLDNEW
« no previous file with comments | « tests/language/adjacent_const_string_literals_test.dart ('k') | tests/language/call_through_getter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698