mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fix assertion with code block lambda
This commit is contained in:
+1
-1
@@ -248,7 +248,7 @@ public class InferenceSessionContainer {
|
||||
final MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(psiCall.getArgumentList());
|
||||
if (properties != null) {
|
||||
if (properties.isApplicabilityCheck() ||
|
||||
parent instanceof PsiLambdaExpression && ((PsiLambdaExpression)parent).hasFormalParameterTypes()) {
|
||||
lambdaExpression != null && lambdaExpression.hasFormalParameterTypes()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with lambda" "true"
|
||||
class A {
|
||||
{
|
||||
bar(() -> foo());
|
||||
}
|
||||
|
||||
private <T> void bar(ThrowableComputable<T, Exception> throwableComputable) {}
|
||||
|
||||
private <K> K foo() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
interface ThrowableComputable<T, T1 extends Throwable> {
|
||||
T compute() throws T1;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// "Replace with lambda" "true"
|
||||
class A {
|
||||
{
|
||||
bar(new Throwabl<caret>eComputable<String, Exception>() {
|
||||
@Override
|
||||
public String compute() throws Exception {
|
||||
return foo();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private <T> void bar(ThrowableComputable<T, Exception> throwableComputable) {}
|
||||
|
||||
private <K> K foo() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
interface ThrowableComputable<T, T1 extends Throwable> {
|
||||
T compute() throws T1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user