/* * @test /nodynamiccopyright/ * @bug 8231827 * @summary Verify behavior w.r.t. non-reifiable types and type test patterns in instanceof * @compile/fail/ref=Reifiable.out -XDrawDiagnostics Reifiable.java */ public class Reifiable implements ReifiableI { private static boolean test(Object o, List l1, List l2) { return o instanceof ListImpl li1 && l1 instanceof ListImpl li2 && l2 instanceof ListImpl li3 && l2 instanceof ListImpl li4 && l1 instanceof Unrelated li5; } public class List {} public class ListImpl extends List {} public class Unrelated {} } interface ReifiableI {}