mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-18 17:20:54 +07:00
Also: fix and unify unchecked warnings for patterns #IDEA-312000 fixed GitOrigin-RevId: 8f47b72ec308cc9b089571ddc486d275d5d8ff4e
22 lines
744 B
Java
22 lines
744 B
Java
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
interface Iface {}
|
|
class Cls implements Iface {}
|
|
class Foo<T> {}
|
|
|
|
class InstanceOfNonReified {
|
|
void test(List<Cls> o) {
|
|
boolean b1 = o instanceof ArrayList<Cls>;
|
|
boolean b2 = <error descr="Inconvertible types; cannot cast 'java.util.List<Cls>' to 'java.util.ArrayList<Iface>'">o instanceof ArrayList<Iface></error>;
|
|
boolean b3 = o instanceof <error descr="'List<Cls>' cannot be safely cast to 'Foo<Cls>'">Foo<Cls></error>;
|
|
}
|
|
|
|
public static void main(String [] args) {
|
|
|
|
Object o = new ArrayList<Object>();
|
|
if (o instanceof <error descr="'Object' cannot be safely cast to 'ArrayList<Integer>'">ArrayList<Integer> ai</error>) {
|
|
System.out.println("");
|
|
}
|
|
}
|
|
} |