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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/warnings.dart
diff --git a/sdk/lib/_internal/compiler/implementation/warnings.dart b/sdk/lib/_internal/compiler/implementation/warnings.dart
index 7d5dcbf30e087af02b5bbb8efdbc1743bac34565..50ce914ef07b967ab523f00d3af0d8fcdc5fd9e4 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -881,6 +881,13 @@ void main() {
const c; // This constant variable must be initialized.
}"""]);
+ static const MessageKind FINAL_WITHOUT_INITIALIZER = const MessageKind(
+ "Error: A final variable must be initialized.",
+ howToFix: "Try adding an initializer or "
+ "removing the 'final' modifier.",
+ examples: const [
+ "class C { static final field; } main() => C.field;"]);
+
static const MessageKind MEMBER_USES_CLASS_NAME = const MessageKind(
"Error: Member variable can't have the same name as the class it is "
"declared in.",
« 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