1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary smoke negative test for datum classes
   4  * @compile/fail/ref=NoAddFieldsCanBeDeclaredInDatumTest.out -XDrawDiagnostics NoAddFieldsCanBeDeclaredInDatumTest.java
   5  */
   6 
   7 public class NoAddFieldsCanBeDeclaredInDatumTest {
   8     record Bad1(int i) {
   9         int y;
  10     }
  11 
  12     record Bad2(int i) {
  13         interface I {}
  14     }
  15 
  16     record Bad3(int i) {
  17         static {}
  18     }
  19 }