stop at lambda also if it is explicitly typed

EA-78231 - SOE: InferenceSessionContainer.infer
This commit is contained in:
Anna Kozlova
2016-02-02 20:02:20 +03:00
parent dc459a4953
commit e7c7fab136
3 changed files with 26 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}
}

View File

@@ -268,6 +268,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testCodeBlockLambdaWithoutParamsIsValueCompatibleChecks() throws Exception {
doTest();
}
private void doTest() {
doTest(false);
}