This commit is contained in:
Anna Kozlova
2015-12-03 19:06:23 +01:00
parent 65194fd5f0
commit b580d8eccb
3 changed files with 23 additions and 0 deletions

View File

@@ -173,6 +173,10 @@ public class MethodCandidateInfo extends CandidateInfo{
final PsiParameter[] parameters = method.getParameterList().getParameters();
final PsiExpression[] expressions = ((PsiExpressionList)myArgumentList).getExpressions();
if (!isVarargs() && expressions.length != parameters.length) {
return true;
}
for (int i = 0; i < expressions.length; i++) {
final PsiExpression expression = expressions[i];
PsiType formalParameterType = i < parameters.length ? parameters[i].getType() : parameters[parameters.length - 1].getType();

View File

@@ -0,0 +1,15 @@
class BB {
public boolean isVarArgCall() {
return false;
}
private static boolean isVarArgCall(String method, String substitutor) {
return false;
}
}
class Test {
void f(BB b){
BB.<error descr="Non-static method 'isVarArgCall()' cannot be referenced from a static context">isVarArgCall</error>();
}
}

View File

@@ -183,6 +183,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testIgnoreNumberOfParametersInPotentiallyCompatibleCheckNotToExcludeAllConflicts() throws Exception {
doTest(false);
}
private void doTest() {
doTest(true);
}