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

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

Issue 10545029: Issue 3181. Only fields of immediately surrounding class can be initialized (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 29d826054d5c2eb62eb483ab279bc2e63866e7f4..ff34689b5613dfc2322bb0e666f0fd6e16d60a52 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -1520,6 +1520,7 @@ public class Resolver {
case FIELD:
FieldElement field = (FieldElement) element;
+ recordElement(x, field);
if (field.isStatic()) {
onError(x, ResolverErrorCode.CANNOT_INIT_STATIC_FIELD_IN_INITIALIZER);
} else if (field.getModifiers().isAbstractField()) {
@@ -1530,7 +1531,7 @@ public class Resolver {
*/
onError(x, ResolverErrorCode.CANNOT_INIT_STATIC_FIELD_IN_INITIALIZER);
} else {
- onError(x, ResolverErrorCode.CANNOT_INIT_FIELD_FROM_SUPERCLASS);
+ onError(x, ResolverErrorCode.INIT_FIELD_ONLY_IMMEDIATELY_SURROUNDING_CLASS);
}
break;

Powered by Google App Engine
This is Rietveld 408576698