[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:04 UTC 2022


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

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

Commit messages:
 - Fix parse error with nested record classes and empty record component list

Changes: https://git.openjdk.java.net/amber/pull/83/files
 Webrev: https://webrevs.openjdk.java.net/?repo=amber&pr=83&range=00
  Stats: 63 lines in 2 files changed: 58 ins; 2 del; 3 mod
  Patch: https://git.openjdk.java.net/amber/pull/83.diff
  Fetch: git fetch https://git.openjdk.java.net/amber pull/83/head:pull/83

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


More information about the amber-dev mailing list