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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.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 | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index 54fa2fdc75188fb613f131b380595c876b5240cf..73723474460c678b4201df23a7e66c5a560e262f 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -3912,13 +3912,16 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<SourceString> {
resolver.error(identifier, MessageKind.REFERENCE_IN_INITIALIZATION,
{'variableName': name.toString()});
}
- return visit(node.selector);
+ return name;
}
SourceString visitIdentifier(Identifier node) {
// The variable is initialized to null.
resolver.world.registerInstantiatedClass(compiler.nullClass,
resolver.mapping);
+ if (definitions.modifiers.isConst()) {
+ compiler.reportError(node, MessageKind.CONST_WITHOUT_INITIALIZER);
+ }
return node.source;
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/warnings.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698