[patterns-record-deconstruction3] RFR: Fix parse error with nested record classes and empty record component list

Aggelos Biboudis duke at openjdk.java.net
Mon May 2 12:58:05 UTC 2022


On Fri, 29 Apr 2022 15:54:13 GMT, Aggelos Biboudis <duke at openjdk.java.net> wrote:

> This PR addresses the following parse error.
> 
> The following snippet of code:
> 
> 
>     interface W {
>         record X1() implements W {}
>     }
> 
>     public int test(W w) {
>         return switch (w) {
>             case W.X1() -> 1;
>         };
>     }
> 
> 
> reports that it cannot find symbol.
> 
> 
> error: cannot find symbol
>             case W.X1() -> 1;
>                   ^
>   symbol:   method X1()
>   location: interface W

thx @lahodaj for offering the complete fix!

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

PR: https://git.openjdk.java.net/amber/pull/83


More information about the amber-dev mailing list