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

Unified Diff: sdk/lib/_internal/compiler/implementation/warnings.dart

Issue 23979004: Check for uninitialized constant variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 3 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 fe0c108f1e311faa46c1f8aca536736e06b98001..a35a6ad734bdfd24c18737bf80d3187c6277d17a 100644
--- a/sdk/lib/_internal/compiler/implementation/warnings.dart
+++ b/sdk/lib/_internal/compiler/implementation/warnings.dart
@@ -783,6 +783,15 @@ foo(t) {
main() => foo(1);
"""]);
+ static const MessageKind CONST_WITHOUT_INITIALIZER = const MessageKind(
+ "Error: A constant variable must be initialized.",
+ howToFix: "Try adding an initializer or "
+ "removing the 'const' modifier.",
+ examples: const ["""
+void main() {
+ const c; // This constant variable must be initialized.
+}"""]);
+
static const MessageKind WRONG_NUMBER_OF_ARGUMENTS_FOR_ASSERT =
const MessageKind(
« 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