Skip to content

Commit

Permalink
Fix testBug80257 and possibly others: resolve correct type binding in…
Browse files Browse the repository at this point in the history
… rare case

Signed-off-by: Rob Stryker <stryker@redhat.com>
  • Loading branch information
Rob Stryker committed Sep 12, 2024
1 parent 871e2a8 commit 4c2c670
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4c2c670

Please sign in to comment.