mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
@NotNull assertion fix
This commit is contained in:
+5
-1
@@ -257,7 +257,11 @@ public class GrParameterImpl extends GrVariableImpl implements GrParameter {
|
||||
GrExpression left = range.getLeftOperand();
|
||||
GrExpression right = range.getRightOperand();
|
||||
if (right != null) {
|
||||
return TypesUtil.getLeastUpperBound(left.getType(), right.getType(), range.getManager());
|
||||
final PsiType leftType = left.getType();
|
||||
final PsiType rightType = right.getType();
|
||||
if (leftType != null && rightType != null) {
|
||||
return TypesUtil.getLeastUpperBound(leftType, rightType, range.getManager());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
+7
-3
@@ -133,9 +133,13 @@ public class GrClosureSignatureImpl implements GrClosureSignature {
|
||||
boolean opt = parameters1[i].isOptional() && parameters2[i].isOptional();
|
||||
params[i] = new GrClosureParameterImpl(/*null, */type, opt, null);
|
||||
}
|
||||
PsiType returnType = TypesUtil.getLeastUpperBound(signature1.getReturnType(), signature2.getReturnType(), manager);
|
||||
boolean isVarArgs = signature1.isVarargs() && signature2.isVarargs();
|
||||
return new GrClosureSignatureImpl(params, returnType, isVarArgs);
|
||||
final PsiType s1type = signature1.getReturnType();
|
||||
final PsiType s2type = signature2.getReturnType();
|
||||
if (s1type != null && s2type != null) {
|
||||
PsiType returnType = TypesUtil.getLeastUpperBound(s1type, s2type, manager);
|
||||
boolean isVarArgs = signature1.isVarargs() && signature2.isVarargs();
|
||||
return new GrClosureSignatureImpl(params, returnType, isVarArgs);
|
||||
}
|
||||
}
|
||||
return null; //todo
|
||||
}
|
||||
|
||||
@@ -192,6 +192,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testGstringAssignableToStringInClosureParameter() throws Exception{doTest();}
|
||||
public void testEverythingAssignableToString() throws Exception {doTest(new GroovyAssignabilityCheckInspection());}
|
||||
|
||||
public void testEachOverRange() throws Exception {doTest();}
|
||||
|
||||
public void testMethodCallWithDefaultParameters() throws Exception {doTest();}
|
||||
public void testClosureWithDefaultParameters() throws Exception {doTest();}
|
||||
public void testClosureCallMethodWithInapplicableArguments() throws Exception {doTest();}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
(date1..date2).each { it }
|
||||
Reference in New Issue
Block a user