1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8334258
4 * @summary Disallow early assignment if FLEXIBLE_CONSTRUCTORS preview feature is not enabled
5 * @compile/fail/ref=EarlyAssignmentNoPreview1.out -source 24 -XDrawDiagnostics EarlyAssignmentNoPreview1.java
6 */
7 public class EarlyAssignmentNoPreview1 {
8
9 Runnable r;
10
11 public EarlyAssignmentNoPreview1() {
12 r = () -> System.out.println("hello");
13 this(r);
14 }
15
16 public EarlyAssignmentNoPreview1(Runnable r) {
17 }
18 }