1 /*
 2  * @test /nodynamiccopyright/
 3  * @bug 8222792
 4  * @summary Javac should enforce the latest relationship rules between an inline type and its nullable projection
 5  * @compile/fail/ref=TypeRelationsNegativeTest.out -XDrawDiagnostics TypeRelationsNegativeTest.java
 6  */
 7 
 8 final primitive class TypeRelationsNegativeTest.val {
 9 
10     void foo() {
11         TypeRelationsNegativeTest.val x = null; // error
12         TypeRelationsNegativeTest xq = null;
13 
14         xq = x;
15         xq = (TypeRelationsNegativeTest) x;
16         xq = (TypeRelationsNegativeTest.val) x;
17         x = xq;
18         x = (TypeRelationsNegativeTest) xq;
19         x = (TypeRelationsNegativeTest.val) xq;
20 
21         TypeRelationsNegativeTest.val [] xa = new TypeRelationsNegativeTest.val[] { null }; // error
22         TypeRelationsNegativeTest [] xqa = new TypeRelationsNegativeTest.ref[] { null };
23 
24         xqa = xa;
25         xqa = (TypeRelationsNegativeTest[]) xa;
26         xa = xqa;// error
27         xa = (TypeRelationsNegativeTest.val []) xqa;
28     }
29     int x = 10;
30 }