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

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

Issue 11740019: Fix issue 7677: recognize const declarations inside methods. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (revision 17259)
+++ sdk/lib/_internal/compiler/implementation/compile_time_constants.dart (working copy)
@@ -462,6 +462,13 @@
if (result != null) return result;
} else if (Elements.isClass(element) || Elements.isTypedef(element)) {
return makeTypeConstant(element);
+ } else if (send.receiver != null) {
+ // Fall through to error handling.
+ } else if (!Elements.isUnresolved(element)
+ && element.isVariable()
+ && element.modifiers.isConst()) {
+ Constant result = handler.compileConstant(element);
+ if (result != null) return result;
}
return signalNotCompileTimeConstant(send);
} else if (send.isCall) {
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698