mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
lambda: don't reject value compatibility for lambdas with control flow problems inside (IDEA-142107)
This commit is contained in:
+2
-3
@@ -117,9 +117,8 @@ public class PsiLambdaExpressionImpl extends ExpressionPsiElement implements Psi
|
||||
return false;
|
||||
}
|
||||
}
|
||||
catch (AnalysisCanceledException e) {
|
||||
return false;
|
||||
}
|
||||
//error would be shown inside body
|
||||
catch (AnalysisCanceledException ignore) {}
|
||||
|
||||
for (PsiReturnStatement statement : PsiUtil.findReturnStatements((PsiCodeBlock)body)) {
|
||||
if (statement.getReturnValue() == null) {
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
class Test {
|
||||
public static void processDifference(final Stream<String> stream, final Stream<String> cells) {
|
||||
stream.map(rule -> {
|
||||
try {
|
||||
return cells.collect(Collectors.toMap(c -> c, null));
|
||||
} finally {
|
||||
System.out.println(<error descr="')' expected"><error descr="Expression expected">;</error></error><error descr="Unexpected token">)</error>;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
+4
@@ -199,6 +199,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testControlFlowAnalysisFailedValueCompatibilityUnchanged() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user