hg: valhalla/valhalla: 8222634: [lworld] Javac sometimes emits incorrect ('Q') descriptors for fields.

Brian Goetz brian.goetz at oracle.com
Wed Apr 17 13:13:15 UTC 2019


>> 
>> (1) Compile time null assignment to values should be tolerated (?)
>> (2) Compiler does not tolerate the following:
>> MyValue1?[] vBoxArray = new MyValue1?[42];
> 
> On (1) can I get a quick confirmation that this is what we want ? I did see some discussion regarding javac not proactively catching these and letting the VM report an NPE. But I seem to have missed the rationale behind that decision against failing early.

On (1), I think this should be done on the basis of value set inclusion.  For reference types, null-default value types, and the nullable-projection of zero-default value types (V?), null is a member of the value set; for primitives, and for zero-default value types, it is not.  I think the compiler should not allow assignment of a value that is not a member of the value set.  

We need better terminology….I said value and null too many times in the above paragraph.  


More information about the valhalla-dev mailing list