diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java index 1b0f8a38cae..ec6be77d752 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java @@ -469,6 +469,17 @@ IBinding resolveNameToJavac(Name name, JCTree tree) { return null; } + IVariableBinding resolveVariable(EnumConstantDeclaration enumConstant) { + resolve(); + Object o = this.converter.domToJavac.get(enumConstant); + if (o instanceof JCVariableDecl decl) { + if (!decl.type.isErroneous() || this.isRecoveringBindings) { + return canonicalize(new JavacVariableBinding(decl.sym, this)); + } + } + return null; + } + @Override IVariableBinding resolveVariable(EnumConstantDeclaration enumConstant) { resolve();