mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-136079 "Contract violation" warnings are reported for inferred method contract for method with varargs
This commit is contained in:
+5
-1
@@ -57,7 +57,11 @@ public class DfaVariableValue extends DfaValue {
|
||||
}
|
||||
|
||||
public DfaVariableValue createVariableValue(PsiVariable myVariable, boolean isNegated) {
|
||||
return createVariableValue(myVariable, myVariable.getType(), isNegated, null);
|
||||
PsiType varType = myVariable.getType();
|
||||
if (varType instanceof PsiEllipsisType) {
|
||||
varType = new PsiArrayType(((PsiEllipsisType)varType).getComponentType());
|
||||
}
|
||||
return createVariableValue(myVariable, varType, isNegated, null);
|
||||
}
|
||||
@NotNull
|
||||
public DfaVariableValue createVariableValue(@NotNull PsiModifierListOwner myVariable,
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
class X {
|
||||
public static String compute(String... s) {
|
||||
if (s == null) return null;
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -40,4 +40,5 @@ public class ContractCheckTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testNestedCallsMayThrow() { doTest(); }
|
||||
|
||||
public void testSignatureIssues() { doTest(); }
|
||||
public void testVarargInferred() { doTest(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user