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

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

Issue 637303005: Type check constant variable declarations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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 import "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 class A<T> { 7 class A<T> {
8 Function closure; 8 Function closure;
9 A._(this.closure); 9 A._(this.closure);
10 10
(...skipping 15 matching lines...) Expand all
26 a = "not_null"; 26 a = "not_null";
27 print(a); 27 print(a);
28 return a; 28 return a;
29 } 29 }
30 30
31 static final 31 static final
32 T /// 04: static type warning, dynamic type error 32 T /// 04: static type warning, dynamic type error
33 staticFinalField = "not_null"; 33 staticFinalField = "not_null";
34 34
35 static const 35 static const
36 T /// 05: static type warning, dynamic type error 36 T /// 05: static type warning, checked mode compile-time error
37 staticConstField = "not_null"; 37 staticConstField = "not_null";
38 38
39 static not_null() => "not_null"; 39 static not_null() => "not_null";
40 static final 40 static final
41 T /// 06: static type warning, dynamic type error 41 T /// 06: static type warning, dynamic type error
42 staticFinalField2 = not_null(); 42 staticFinalField2 = not_null();
43 43
44 // Assigning null to a malformed type is not a dynamic error. 44 // Assigning null to a malformed type is not a dynamic error.
45 static 45 static
46 T staticMethod2(T a) { 46 T staticMethod2(T a) {
(...skipping 25 matching lines...) Expand all
72 72
73 A.staticMethod("not_null"); 73 A.staticMethod("not_null");
74 print(A.staticFinalField); 74 print(A.staticFinalField);
75 print(A.staticConstField); 75 print(A.staticConstField);
76 print(A.staticFinalField2); 76 print(A.staticFinalField2);
77 77
78 A.staticMethod2(null); 78 A.staticMethod2(null);
79 print(A.staticFinalField3); 79 print(A.staticFinalField3);
80 print(A.staticFinalField4); 80 print(A.staticFinalField4);
81 } 81 }
OLDNEW
« pkg/analyzer/lib/src/generated/error.dart ('K') | « tests/language/language_analyzer2.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698