[lworld] RFR: Make "PrimitiveParameterizedClass.default" a poly expression. [v5]

Srikanth Adayapalam sadayapalam at openjdk.java.net
Mon Aug 2 14:47:45 UTC 2021


On Mon, 2 Aug 2021 11:01:01 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:

>> Jesper Steen Møller has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Whitespace
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/tree/TreeInfo.java line 284:
> 
>> 282:         if (applyTree != null) {
>> 283:             return applyTree.arguments.isEmpty();
>> 284:         } else {
> 
> The return statement is not reachable and so the block is not useful. This is because, Foo<>.default is a syntax error. Given a primitive class Foo<T> we will only support Foo.default involving implicit diamond like inference and will not support Foo<>.default which is what this code is handling.

(I think I meant to say return applyTree.arguments.isEmpty(); will never be true.)

-------------

PR: https://git.openjdk.java.net/valhalla/pull/369


More information about the valhalla-dev mailing list