mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
diamonds: fix parent hunting inside anonymous class (IDEA-259666)
GitOrigin-RevId: 51f47646dbe68e9182b75e3058b0d1216ada92e6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
328c05d165
commit
0a73a79b70
@@ -741,9 +741,9 @@ public final class LambdaUtil {
|
||||
break;
|
||||
}
|
||||
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiMember.class, PsiVariable.class,
|
||||
final PsiCall psiCall = PsiTreeUtil.getParentOfType(parent, PsiCall.class, false, PsiVariable.class, PsiMethod.class,
|
||||
PsiAssignmentExpression.class, PsiTypeCastExpression.class);
|
||||
if (psiCall == null) {
|
||||
if (psiCall == null || !PsiTreeUtil.isAncestor(psiCall.getArgumentList(), parent, false)) {
|
||||
break;
|
||||
}
|
||||
if (MethodCandidateInfo.isOverloadCheck(psiCall.getArgumentList()) ||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import java.util.*;
|
||||
|
||||
class MyTest {
|
||||
private static <K, V> HashMap<K, V> createMultiMap(boolean identityKeys) {
|
||||
return new HashMap<>(identityKeys ? new HashMap<>() : Collections.emptyMap()) {};
|
||||
}
|
||||
}
|
||||
@@ -111,6 +111,8 @@ public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testNestedDiamondsInsideAssignmentInMethodsCall() { doTest();}
|
||||
|
||||
public void testNestedDiamondsAnonymousCase() { doTest();}
|
||||
|
||||
private void doTest() {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user