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 952f7bbb115..d787553e4d7 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 @@ -1092,7 +1092,11 @@ IBinding resolveNameToJavac(Name name, JCTree tree) { return this.bindings.getTypeBinding(variableDecl.type); } if (tree instanceof JCFieldAccess fieldAccess && fieldAccess.sym != null) { - return this.bindings.getBinding(fieldAccess.sym, fieldAccess.type); + com.sun.tools.javac.code.Type typeToUse = fieldAccess.type; + if(fieldAccess.selected instanceof JCTypeApply) { + typeToUse = fieldAccess.sym.type; + } + return this.bindings.getBinding(fieldAccess.sym, typeToUse); } if (tree instanceof JCMethodInvocation methodInvocation && methodInvocation.meth.type != null) { return this.bindings.getBinding(((JCFieldAccess)methodInvocation.meth).sym, methodInvocation.meth.type);