1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary Ensure that in type test patterns, the predicate is not trivially provable false.
   4  * @compile/fail/ref=ImpossibleTypeTest.out -XDrawDiagnostics ImpossibleTypeTest.java
   5  */
   6 public class ImpossibleTypeTest {
   7 
   8     public static void main(String[] args) {
   9 
  10         int in = 42;
  11         Integer i = 42;
  12 
  13         if (i instanceof String s ) {
  14             System.out.println("Broken");
  15         }
  16         if (i instanceof Undefined u ) {
  17             System.out.println("Broken");
  18         }
  19     }
  20 }