RFR: 8357361: Exception when compiling switch expression with inferred type.

Jan Lahoda jlahoda at openjdk.org
Wed May 21 15:35:03 UTC 2025


There's a missing erasure in `TransTypes`, which eventually leads to an attempt to cast to a captured wildcard type (for the case shown in the bug report), which cannot be done. (In this case, `TransTypes` will report an error.)

(There's a unused/unnecessary code in the close vicinity of the added erasure, and a similar code in `visitSwitch`. I could resist deleting that unnecessary code.)

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

Commit messages:
 - 8357361: Exception when compiling switch expression with inferred type.

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

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


More information about the compiler-dev mailing list