1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary Basic pattern bindings scope test
   4  * @compile/fail/ref=DuplicateBindingTest.out -XDrawDiagnostics DuplicateBindingTest.java
   5  */
   6 
   7 public class DuplicateBindingTest {
   8 
   9     int f;
  10 
  11     public static void main(String[] args) {
  12 
  13         if (args != null) {
  14             int s;
  15             if (args[0] instanceof String s) { // NOT OK. Redef same scope.
  16             }
  17             if (args[0] instanceof String f) { // OK to redef field.
  18             }
  19         }
  20     }
  21 }