mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
highlighting: don't add warning for nested lambda when problem is inside upper level (IDEA-155192)
This commit is contained in:
@@ -456,7 +456,7 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
public String getParentInferenceErrorMessage(PsiExpressionList list) {
|
||||
String errorMessage = getInferenceErrorMessage();
|
||||
while (errorMessage == null) {
|
||||
list = PsiTreeUtil.getParentOfType(list, PsiExpressionList.class, true);
|
||||
list = PsiTreeUtil.getParentOfType(list, PsiExpressionList.class, true, PsiCodeBlock.class);
|
||||
if (list == null) {
|
||||
break;
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import java.util.Set;
|
||||
|
||||
class Test {
|
||||
void foo(Set<String> outer, Set<String> inner) {
|
||||
outer.stream().map((String f)-> {
|
||||
inner.stream().filter(
|
||||
(String s)->{return true;}
|
||||
);
|
||||
<error descr="Missing return statement">}</error>);
|
||||
}
|
||||
}
|
||||
+4
@@ -312,6 +312,10 @@ public class NewLambdaHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDontWarnAboutNestedLambdaForAProblemInOuter() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user