hg: valhalla/valhalla: 8222402: [lworld] LW2 array support in javac

Srikanth srikanth.adayapalam at oracle.com
Mon Apr 22 13:01:16 UTC 2019


I meant to add all the code snippets in 
https://mail.openjdk.java.net/pipermail/valhalla-dev/2019-April/005600.html 
are covered by the new tests.

That page says:

     qa = (Foo[]) la; // should fail to compile if type known

The only case as far as I can see, where the type is "known" to javac to 
warrant a failure is:

     qa = new Foo[] { ... null, ... };

At at other places, javac will go with the declared/static type which 
would permit the cast and defer any problem reporting to a CCE at 
runtime (which is missing ATM BTW)

Srikanth.






On 22/04/19 6:27 PM, Srikanth wrote:
> With javac cleaning up the notions of type relations between an inline 
> type and its null projection,
> what is required for array support from javac automatically falls into 
> place.
>
> I have pushed this changeset with tests to assert that
>
>     - "[QFoo;" <: "[LFoo;” <: “[LObject;” <: “Object;"
>     - That we can freely allow widening conversion, but not narrowing. 
> I.e. narrow checkcast must match [Q...
>
> In general thing work as expected, I did find one problem
>
>     Foo?[] fa = new Foo?[10];
>     Foo [] qa = (Foo []) fa;  // <------- No CCE here yet.
>
> Thanks!
> Srikanth
>
> On 22/04/19 6:20 PM, srikanth.adayapalam at oracle.com wrote:
>> Changeset: 2da7a1ed0104
>> Author:    sadayapalam
>> Date:      2019-04-22 18:20 +0530
>> URL: http://hg.openjdk.java.net/valhalla/valhalla/rev/2da7a1ed0104
>>
>> 8222402: [lworld] LW2 array support in javac
>>
>> + 
>> test/langtools/tools/javac/valhalla/lworld-values/ArrayRelationsTest.java
>>
>




More information about the valhalla-dev mailing list