Files
openide/java/java-tests/testData/codeInsight/completion/normal/ComplexInstanceOfDfa.java
Tagir Valeev 390cec4927 TypeConstraint#union: smarter merge of supertypes
union("is X, Y; not SubX", "is SubX, Y") now produces "is X, Y"; before it was "is Y".
Fixes IDEA-184153 Smart-cast completion fails
2017-12-22 12:42:40 +07:00

25 lines
483 B
Java

import java.math.BigInteger;
import java.util.function.Function;
class Test {
interface X {
void methodFromX();
void methodFromX2();
}
interface Y {
void methodFromY();
void methodFromY2();
}
interface Z extends X {}
void test(Object obj) {
if(obj instanceof Z && Math.random() > 0.5) {
return;
}
if(obj instanceof X && obj instanceof Y) {
obj.method<caret>
}
}
}