1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary smoke negative test for datum classes
   4  * @compile/fail/ref=NoAddInstanceFieldsCanBeDeclaredInDatumTest.out -XDrawDiagnostics NoAddInstanceFieldsCanBeDeclaredInDatumTest.java
   5  */
   6 
   7 public class NoAddInstanceFieldsCanBeDeclaredInDatumTest {
   8     record Bad1(int i) {
   9         int y;
  10     }
  11 
  12     record Good1(int i) {
  13         interface I {}
  14     }
  15 
  16     record Good2(int i) {
  17         static {}
  18     }
  19 
  20     record Good3(int i) {
  21         enum E {A, B}
  22     }
  23 
  24     record Good4(int i) {
  25         {}
  26     }
  27 }