1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary check that the compiler doesn't accept canonical constructors with wrong accessibility
   4  * @compile/fail/ref=BadCanonicalConstructorTest.out -XDrawDiagnostics BadCanonicalConstructorTest.java
   5  */
   6 
   7 public class BadCanonicalConstructorTest {
   8     record R1() {
   9         private R1 {}
  10     }
  11 
  12     record R2() {
  13         protected R2 {}
  14     }
  15 
  16     record R3() {
  17         R3 {}
  18     }
  19 }