[debugger] fixed varargs methods invocation in compiling evaluator

GitOrigin-RevId: 58b385d1b54566545d1a0beb146613593b87e825
This commit is contained in:
Egor Ushakov
2025-05-20 14:10:30 +02:00
committed by intellij-monorepo-bot
parent 9f9c5e139a
commit e5c1feb598

View File

@@ -172,6 +172,7 @@ final class PsiReflectionAccessUtil {
}
public static @NotNull PsiType nearestAccessibleType(@NotNull PsiType type, @NotNull PsiElement context) {
boolean ellipsis = type instanceof PsiEllipsisType;
while (!isAccessibleType(type)) {
PsiClass psiClass = PsiTypesUtil.getPsiClass(type);
boolean isAccessible = isAccessible(psiClass);
@@ -184,6 +185,9 @@ final class PsiReflectionAccessUtil {
return PsiType.getJavaLangObject(context.getManager(), context.getResolveScope());
}
type = types[0];
if (ellipsis && type instanceof PsiArrayType arrayType) {
type = new PsiEllipsisType(arrayType.getComponentType());
}
}
return type;