RFR: 8336786: VerifyError with lambda capture and enclosing instance references [v2]

Liam Miller-Cushon cushon at openjdk.org
Fri Jul 19 17:02:08 UTC 2024


> Hi, please consider this fix for [JDK-8336786](https://bugs.openjdk.org/browse/JDK-8336786). After [JDK-8334037](https://bugs.openjdk.org/browse/JDK-8334037) the handling of capturing `this` in lambdas does not handle synthetic `this` variables declared in supertypes in different packages. This change adjusts the lowering of `this` references to be owned by the enclosing class, instead of the superclass, so they are handle correctly be the capture logic in `capturedDecl` in `LambdaToMethod`.

Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:

  Add assertion in capturedDecl

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/20259/files
  - new: https://git.openjdk.org/jdk/pull/20259/files/5dba4fcd..430301ed

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=20259&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=20259&range=00-01

  Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/20259.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20259/head:pull/20259

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


More information about the compiler-dev mailing list