1 /*
 2  * @test /nodynamiccopyright/
 3  * @summary null cannot be casted to and compared with value types.
 4  *
 5  * @compile/fail/ref=CheckNullCastable.out -XDrawDiagnostics CheckNullCastable.java
 6  */
 7 
 8 primitive final class CheckNullCastable.val {
 9     void foo(CheckNullCastable.val cnc) {
10         CheckNullCastable.val cncl = (CheckNullCastable.val) null;
11         if (cnc != null) {};
12         if (null != cnc) {};
13     }
14     int x = 10;
15 }