mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
TypeConstraint: fix deep hierarchy union (IDEA-CR-31134)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import java.math.BigInteger;
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
interface Base {
|
||||
void baseMethod();
|
||||
}
|
||||
|
||||
interface A1 extends Base {}
|
||||
interface A2 extends Base {}
|
||||
interface B1 extends A1 {}
|
||||
interface B2 extends A2 {}
|
||||
interface C1 extends B1 {}
|
||||
|
||||
long test(Object obj) {
|
||||
if (obj instanceof C1 || obj instanceof A2) {
|
||||
obj.baseMe<caret>
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import java.math.BigInteger;
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
interface Base {
|
||||
void baseMethod();
|
||||
}
|
||||
|
||||
interface A1 extends Base {}
|
||||
interface A2 extends Base {}
|
||||
interface B1 extends A1 {}
|
||||
interface B2 extends A2 {}
|
||||
interface C1 extends B1 {}
|
||||
|
||||
long test(Object obj) {
|
||||
if (obj instanceof C1 || obj instanceof A2) {
|
||||
((Base) obj).baseMethod();
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user