mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-220464 Smart-cast completion doesn't insert <?>
GitOrigin-RevId: 175651a3f6cf5736ca7676b9fe80b569d4260962
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e3367716c0
commit
a0111f91d0
-3
@@ -1599,9 +1599,6 @@ public class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
if (checkType != null) {
|
||||
operand.accept(this);
|
||||
PsiType type = checkType.getType();
|
||||
if (type instanceof PsiClassType) {
|
||||
type = ((PsiClassType)type).rawType();
|
||||
}
|
||||
addInstruction(new PushInstruction(myFactory.createTypeValue(type, Nullability.NOT_NULL), null));
|
||||
addInstruction(new InstanceofInstruction(expression, operand, type));
|
||||
}
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import java.util.List;
|
||||
|
||||
class Foo {
|
||||
{
|
||||
Object o;
|
||||
int size = o instanceof List<?> ? ((List<?>) o).size() : <caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import java.util.List;
|
||||
|
||||
class Foo {
|
||||
{
|
||||
Object o;
|
||||
int size = o instanceof List<?> ? o.size<caret>
|
||||
}
|
||||
}
|
||||
+2
@@ -80,4 +80,6 @@ class SmartTypeCompletionDfaTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
void testInstanceofedInsideAnonymous() { doTest() }
|
||||
|
||||
void testCastToTypeWithWildcard() { doTest() }
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user