| Index: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
|
| diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
|
| index 82a1017b89851c73d7ccaa5718a55e68c5bbdf78..ae8d2e4f4bae8b08f8bfbb975b6bec7c9caace27 100644
|
| --- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
|
| +++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
|
| @@ -800,7 +800,9 @@ public class CompileTimeConstantAnalyzer {
|
| NodeElement element = node.getElement();
|
| if (ElementKind.of(element) == ElementKind.FIELD) {
|
| FieldElement fieldElement = (FieldElement) element;
|
| - if (!fieldElement.isStatic()) {
|
| + boolean isStatic = fieldElement.getModifiers().isStatic()
|
| + || Elements.isTopLevel(fieldElement);
|
| + if (!isStatic) {
|
| context.onError(new DartCompilationError(node,
|
| ResolverErrorCode.CANNOT_USE_INSTANCE_FIELD_IN_INSTANCE_FIELD_INITIALIZER));
|
| }
|
|
|