Chromium Code Reviews| 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 fb43f949ee5105e03a8488c9c3164ac1480b66fb..7808c4dd229b778818debf3e4e3f5dd20b34aa27 100644 |
| --- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
| +++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java |
| @@ -1235,7 +1235,10 @@ public class Resolver { |
| if (!Elements.isStaticContext(element) && !element.getModifiers().isConstant()) { |
| if (inInstanceVariableInitializer) { |
| onError(x, ResolverErrorCode.CANNOT_USE_INSTANCE_FIELD_IN_INSTANCE_FIELD_INITIALIZER); |
| - } else if (ASTNodes.isStaticContext(x)) { |
| + } |
| + } |
| + if (ASTNodes.isStaticContext(x) && !Elements.isStaticContext(element)) { |
| + if (ASTNodes.isStaticContext(x)) { |
|
Brian Wilkerson
2012/11/02 18:01:23
Why are we testing this again? Don't we already kn
|
| onError(x, ResolverErrorCode.ILLEGAL_FIELD_ACCESS_FROM_STATIC, name); |
| } |
| } |