boolean (PsiType migrationType, int paramId, PsiExpression[] actualParams) { if (migrationType instanceof PsiEllipsisType) { if (actualParams.length == paramId) { // no arguments for ellipsis return true; } else if (actualParams.length == paramId + 1) { // only one argument for ellipsis return TypeConversionUtil.areTypesAssignmentCompatible(migrationType, actualParams[paramId]) || TypeConversionUtil.areTypesAssignmentCompatible(((PsiEllipsisType)migrationType).getComponentType(), actualParams[paramId]); } else if (actualParams.length > paramId + 1) { // few arguments PsiType componentType = ((PsiEllipsisType)migrationType).getComponentType(); for (int i = paramId; i < actualParams.length; i++) { if (!TypeConversionUtil.areTypesAssignmentCompatible(componentType, actualParams[i])) { return false; } } return true; } throw new AssertionError(" migrationType: " + migrationType + ", paramId: " + paramId + ", actualParameters: " + Arrays.toString(actualParams)); } else { if (paramId >= actualParams.length) return true; return TypeConversionUtil.areTypesAssignmentCompatible(migrationType, actualParams[paramId]); } }