Skip to content

Commit 5a2b33f

Browse files
committed
Fix testMethodDeclarationsElementPatternMultipleParamArguments05
Signed-off-by: Rob Stryker <[email protected]>
1 parent b4db532 commit 5a2b33f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacBindingResolver.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ IMethodBinding resolveMethod(MethodInvocation method) {
905905

906906
// Let's handle error types first
907907
if (type instanceof ErrorType errorType ) {
908+
var parentType = javacElement instanceof JCFieldAccess fa ? fa.getExpression() != null ? fa.getExpression().type : null : null;
908909
com.sun.tools.javac.code.Type original = errorType;
909910
while(original instanceof ErrorType et && original != et.getOriginalType()) {
910911
original = et.getOriginalType();
@@ -914,7 +915,9 @@ IMethodBinding resolveMethod(MethodInvocation method) {
914915
if (sym.owner instanceof TypeSymbol typeSymbol) {
915916
Iterator<Symbol> methods = typeSymbol.members().getSymbolsByName(sym.getSimpleName(), m -> methodType.equals(m.type)).iterator();
916917
if (methods.hasNext()) {
917-
return this.bindings.getMethodBinding(methodType instanceof ForAll forAll ? (ExecutableType)forAll.qtype : methodType, (MethodSymbol)methods.next(), null, false, typeArgs);
918+
ExecutableType mt2 = methodType instanceof ForAll forAll ? (ExecutableType)forAll.qtype : methodType;
919+
MethodSymbol ms = (MethodSymbol)methods.next();
920+
return this.bindings.getMethodBinding(mt2, ms, parentType, false, typeArgs);
918921
}
919922
}
920923
return this.bindings.getErrorMethodBinding(methodType, sym, typeArgs);

0 commit comments

Comments
 (0)