1 /*
 2  * @test /nodynamiccopyright/
 3  * @summary Check for cycles through fields declared flattenable.
 4  *
 5  * @compile/fail/ref=CheckFlattenableCycles.out -XDrawDiagnostics CheckFlattenableCycles.java
 6  */
 7 
 8 final primitive class CheckFlattenableCycles {
 9     class InnerRef {
10         CheckFlattenableCycles cfc;
11     }
12     primitive final class InnerValue {
13         final CheckFlattenableCycles     cfc = CheckFlattenableCycles.default; // Error.
14     }
15     final CheckFlattenableCycles cfc = CheckFlattenableCycles.default; // Error.
16     final int i = 10;
17     final String s = "blah";
18     final InnerRef ir = new InnerRef(); // OK.
19     final InnerValue     iv = InnerValue.default; // Error
20 }