mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
diamond: reject diamonds nested inside type arguments as soon as possible (IDEA-155153)
This commit is contained in:
@@ -104,7 +104,8 @@ public class PsiDiamondTypeImpl extends PsiDiamondType {
|
||||
|
||||
@Override
|
||||
public DiamondInferenceResult resolveInferredTypes() {
|
||||
final PsiNewExpression newExpression = PsiTreeUtil.getParentOfType(myTypeElement, PsiNewExpression.class);
|
||||
PsiElement typeElementWithDiamondTypeArgument = myTypeElement.getParent();
|
||||
final PsiNewExpression newExpression = PsiTreeUtil.getParentOfType(typeElementWithDiamondTypeArgument, PsiNewExpression.class, true, PsiTypeElement.class);
|
||||
if (newExpression == null) {
|
||||
return PsiDiamondTypeImpl.DiamondInferenceResult.NULL_RESULT;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
|
||||
{
|
||||
List<List<String>> l = new ArrayList<List<<error descr="Cannot infer arguments"></error>>>();
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,7 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testDiamondNeg13() { doTest(false, false); }
|
||||
public void testDiamondNeg14() { doTest(false, false); }
|
||||
public void testDiamondMisc() { doTest(false, false); }
|
||||
public void testNestedDiamond() { doTest(false, false); }
|
||||
public void testMultipleConstructors() { doTest(false, false); }
|
||||
public void testHighlightInaccessibleFromClassModifierList() { doTest(false, false); }
|
||||
public void testInnerInTypeArguments() { doTest(false, false); }
|
||||
|
||||
Reference in New Issue
Block a user