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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 23531063: Check that constant locals have constant initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove blank lines. 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 | tests/language/constant_locals_test.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 73723474460c678b4201df23a7e66c5a560e262f..3e1ca3876bee5480ed667c19753cc02268d64720 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -3931,6 +3931,11 @@ class VariableDefinitionsVisitor extends CommonResolverVisitor<SourceString> {
VariableElement element =
new VariableElementX(name, variables, kind, link.head);
resolver.defineElement(link.head, element);
+ if (definitions.modifiers.isConst()) {
+ compiler.enqueuer.resolution.addPostProcessAction(element, () {
+ compiler.constantHandler.compileVariable(element, isConst: true);
+ });
+ }
}
}
}
« no previous file with comments | « no previous file | tests/language/constant_locals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698