Integrated: 8262889: Compiler implementation for Record Patterns
Jan Lahoda
jlahoda at openjdk.java.net
Wed May 25 11:59:20 UTC 2022
On Tue, 3 May 2022 12:07:50 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> 8262889: Compiler implementation for Record Patterns
>
> A first version of a patch that introduces record patterns into javac as a preview feature. For the specification, please see:
> http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-jls.html
>
> There are two notable tricky parts:
> -in the parser, it was necessary to improve the `analyzePattern` method to handle nested/record patterns, while still keeping error recovery reasonable
> -in the `TransPatterns`, the desugaring of the record patterns is very straightforward - effectivelly the record patterns are desugared into guards/conditions. This will likely be improved in some future version/preview
>
> `MatchException` has been extended to cover additional cases related to record patterns.
This pull request has now been integrated.
Changeset: e9bddc18
Author: Jan Lahoda <jlahoda at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/e9bddc18ab91c29d491b0e3bd145d641f6a62c5d
Stats: 2255 lines in 50 files changed: 2169 ins; 15 del; 71 mod
8262889: Compiler implementation for Record Patterns
Co-authored-by: Brian Goetz <briangoetz at openjdk.org>
Co-authored-by: Jan Lahoda <jlahoda at openjdk.org>
Co-authored-by: Aggelos Biboudis <abimpoudis at openjdk.org>
Reviewed-by: mcimadamore, vromero
-------------
PR: https://git.openjdk.java.net/jdk/pull/8516
More information about the core-libs-dev
mailing list