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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/Resolver.java

Issue 10536164: Issue 3550. Initial understanding "const". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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
Index: compiler/java/com/google/dart/compiler/resolver/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index 7b88ed146532d7e4709e6eb3e1b02ef4297ea07c..1aa79b7ba51d43b85d356887f0c83f98ab48dbf5 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -671,7 +671,9 @@ public class Resolver {
Elements.setType(element, fieldType);
}
} else if (isFinal) {
- if (isStatic) {
+ if (modifiers.isConstant()) {
+ onError(node, ResolverErrorCode.CONST_REQUIRES_VALUE);
+ } else if (isStatic) {
onError(node, ResolverErrorCode.STATIC_FINAL_REQUIRES_VALUE);
} else if (isTopLevel) {
onError(node, ResolverErrorCode.TOPLEVEL_FINAL_REQUIRES_VALUE);

Powered by Google App Engine
This is Rietveld 408576698