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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 25504002: Emit a compile-time error for uninitialized final variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: dart2dart status file. Created 7 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of dart2js; 5 part of dart2js;
6 6
7 const DONT_KNOW_HOW_TO_FIX = ""; 7 const DONT_KNOW_HOW_TO_FIX = "";
8 8
9 /** 9 /**
10 * The messages in this file should meet the following guide lines: 10 * The messages in this file should meet the following guide lines:
(...skipping 863 matching lines...) Expand 10 before | Expand all | Expand 10 after
874 874
875 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind( 875 static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind(
876 "Error: A constant variable must be initialized.", 876 "Error: A constant variable must be initialized.",
877 howToFix: "Try adding an initializer or " 877 howToFix: "Try adding an initializer or "
878 "removing the 'const' modifier.", 878 "removing the 'const' modifier.",
879 examples: const [""" 879 examples: const ["""
880 void main() { 880 void main() {
881 const c; // This constant variable must be initialized. 881 const c; // This constant variable must be initialized.
882 }"""]); 882 }"""]);
883 883
884 static const MessageKind FINAL_WITHOUT_INITIALIZER = const MessageKind(
885 "Error: A final variable must be initialized.",
886 howToFix: "Try adding an initializer or "
887 "removing the 'final' modifier.",
888 examples: const [
889 "class C { static final field; } main() => C.field;"]);
890
884 static const MessageKind MEMBER_USES_CLASS_NAME = const MessageKind( 891 static const MessageKind MEMBER_USES_CLASS_NAME = const MessageKind(
885 "Error: Member variable can't have the same name as the class it is " 892 "Error: Member variable can't have the same name as the class it is "
886 "declared in.", 893 "declared in.",
887 howToFix: "Try renaming the variable.", 894 howToFix: "Try renaming the variable.",
888 examples: const [""" 895 examples: const ["""
889 class A { var A; } 896 class A { var A; }
890 main() { 897 main() {
891 var a = new A(); 898 var a = new A();
892 a.A = 1; 899 a.A = 1;
893 } 900 }
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
1369 1376
1370 class CompileTimeConstantError extends Diagnostic { 1377 class CompileTimeConstantError extends Diagnostic {
1371 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse) 1378 CompileTimeConstantError(MessageKind kind, Map arguments, bool terse)
1372 : super(kind, arguments, terse); 1379 : super(kind, arguments, terse);
1373 } 1380 }
1374 1381
1375 class CompilationError extends Diagnostic { 1382 class CompilationError extends Diagnostic {
1376 CompilationError(MessageKind kind, Map arguments, bool terse) 1383 CompilationError(MessageKind kind, Map arguments, bool terse)
1377 : super(kind, arguments, terse); 1384 : super(kind, arguments, terse);
1378 } 1385 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698