mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
stop at lambda also if it is explicitly typed
EA-78231 - SOE: InferenceSessionContainer.infer
This commit is contained in:
@@ -938,6 +938,8 @@ public class InferenceSession {
|
||||
List<ConstraintFormula> newConstraints = new ArrayList<ConstraintFormula>();
|
||||
for (int i = myConstraintIdx; i < myConstraints.size(); i++) {
|
||||
ConstraintFormula constraint = myConstraints.get(i);
|
||||
//register expression in map to mark as "in progress"
|
||||
constraint.apply(PsiSubstitutor.EMPTY, true);
|
||||
if (!constraint.reduce(this, newConstraints)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
class Test {
|
||||
{
|
||||
bar(new ThrowableComputable<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;
|
||||
}
|
||||
}
|
||||
@@ -268,6 +268,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testCodeBlockLambdaWithoutParamsIsValueCompatibleChecks() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user