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

Srikanth Adayapalam sadayapalam at openjdk.java.net
Tue Aug 3 09:23:48 UTC 2021

On Sun, 25 Jul 2021 21:14:57 GMT, Jesper Steen Møller <jespersm at openjdk.org> wrote:

>> Make .default a separate node type in the parser.
>> ## Issue
>> [JDK-8211914](https://bugs.openjdk.java.net/browse/JDK-8211914): [lworld] Javac should support type inference for default value creation
>> Note: The Linux x86 builds in GitHub actions seem to fail with something completely unrelated to these changes.
> 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/comp/ArgumentAttr.java line 736:

> 734:      */
> 735:     class ResolvedDefaultType extends ResolvedMemberType<JCDefaultValue> {
> 736: 

I am surprised that ResolvedDefaultType extends ResolvedMemberType rather than ArgumentType directly. While the Inference behavior could be indirectly modelled it as if the class has a generic factory method named 'default':

<T> static Foo<T> default() { ... }

this implementation detail could be pushed deep down and not manifest here and in  elsewhere (setPolyKind())


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

More information about the valhalla-dev mailing list