2019-11-27 08:00:01 +00:00
|
|
|
/*
|
|
|
|
* @test /nodynamiccopyright/
|
|
|
|
* @bug 8231827
|
|
|
|
* @summary Verify behavior w.r.t. non-reifiable types in instanceof
|
2022-07-29 17:35:22 +00:00
|
|
|
* @compile/fail/ref=ReifiableOld-old.out --release 15 -XDrawDiagnostics ReifiableOld.java
|
2020-11-05 08:01:33 +00:00
|
|
|
* @compile/fail/ref=ReifiableOld.out -XDrawDiagnostics ReifiableOld.java
|
2019-11-27 08:00:01 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
public class ReifiableOld implements ReifiableOldI {
|
|
|
|
private static boolean test(Object o, List<ReifiableOld> l1, List<String> l2) {
|
|
|
|
return o instanceof ListImpl<ReifiableOld> &&
|
|
|
|
l1 instanceof ListImpl<ReifiableOld> &&
|
|
|
|
l2 instanceof ListImpl<ReifiableOld> &&
|
|
|
|
l2 instanceof ListImpl<String> &&
|
|
|
|
l1 instanceof Unrelated<ReifiableOld>;
|
|
|
|
}
|
|
|
|
|
|
|
|
public class List<T> {}
|
|
|
|
public class ListImpl<T extends ReifiableOldI> extends List<T> {}
|
|
|
|
public class Unrelated<T> {}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface ReifiableOldI {}
|