RFR: JDK-8240998: Implement javac changes for deconstruction patterns.
Jan Lahoda
jan.lahoda at oracle.com
Thu Mar 19 10:42:32 UTC 2020
Hi Vicente,
On 18. 03. 20 18:29, Vicente Romero wrote:
> Hi Jan,
>
> Shouldn't this patch also modify some of the visitors at javax.lang.model?
With the pattern matching for instanceof in JDK14, we have added
ElementKind.BINDING_VARIABLE, and the deconstruction patterns are using
that as well. Otherwise, the deconstruction patterns shouldn't (I hope)
affect declarations modeled by javax.lang.model? I.e. this only adds a
new form of patterns, which are only specific to expressions, which are
not modeled by javax.lang.model. Updates to the Trees API are part of
the patch.
Thanks,
Jan
>
> Thanks,
> Vicente
>
> On 3/18/20 4:55 AM, Jan Lahoda wrote:
>> Hi,
>>
>> I would like to ask for a review for a patch that implements the
>> deconstruction patterns, as described in JEP 375:
>> https://bugs.openjdk.java.net/browse/JDK-8235186
>>
>> The current specification draft is here:
>> http://cr.openjdk.java.net/~gbierman/jep375/jep375-20200316/specs/patterns-instanceof-jls.html
>>
>>
>> For this phase, the proposal is for javac to desugar the
>> deconstruction patterns using record accessors.
>>
>> The CSR for this change is being written here:
>> https://bugs.openjdk.java.net/browse/JDK-8240999
>>
>> The proposed patch:
>> http://cr.openjdk.java.net/~jlahoda/8240998/webrev.00
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8240998
>>
>> Any feedback is welcome!
>>
>> Thanks,
>> Jan
>
More information about the compiler-dev
mailing list