mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 09:19:13 +07:00
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
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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>
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user