RFR: 8320145: Compiler should accept final variable in Record Pattern

Aggelos Biboudis abimpoudis at openjdk.org
Thu Nov 30 11:08:18 UTC 2023


With this PR, if the `final` keyword is detected, `analyzePattern` returns `PatternResult.PATTERN` and `parseCaseLabel` goes through the correct if-branch in line 3268.

This improves the error message in the case of record patterns for https://github.com/openjdk/jdk/pull/15997 as well.

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

Commit messages:
 - 8320145: Compiler should accept final variable in Record Pattern

Changes: https://git.openjdk.org/jdk/pull/16899/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16899&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8320145
  Stats: 48 lines in 3 files changed: 44 ins; 2 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/16899.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16899/head:pull/16899

PR: https://git.openjdk.org/jdk/pull/16899


More information about the compiler-dev mailing list