1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary check that the compiler doesn't accept canonical constructors with name mismatch
   4  * @compile/fail/ref=MismatchTest.out -XDrawDiagnostics MismatchTest.java
   5  */
   6 
   7 import java.util.*;
   8 
   9 public class MismatchTest {
  10     record R1(int i, int j) {
  11         public R1(int j, int i) {} // doesn't match by name
  12     }
  13 
  14     record R2(int i, List<String> ls) {
  15         public R2(int i, List ls) {}
  16     }
  17 }