RFR: 8347291: Exhaustive switch over a generic sealed abstract class [v2]
Liam Miller-Cushon
cushon at openjdk.org
Sun Apr 6 04:52:12 UTC 2025
> This change avoids javac incorrectly reporting switches like the example in [JDK-8347291](https://bugs.openjdk.org/browse/JDK-8347291) as exhaustive.
>
> As Jan noted in the bug it seems like the inference behaviour here may not be correct. If it was able to infer a type without crashing that would also avoid the bug.
>
> However with the current inference behaviour, it's safer to assume that if inference crashes the subtype may need to be handled by the switch, instead of assuming that it doesn't.
Liam Miller-Cushon has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
- Handle error types in InferenceUnitTest
- Merge remote-tracking branch 'origin/master' into JDK-8347291
- Merge remote-tracking branch 'origin/master' into JDK-8347291
- 8347291: Exhaustive switch over a generic sealed abstract class
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/23286/files
- new: https://git.openjdk.org/jdk/pull/23286/files/d7029901..db7305a8
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=23286&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=23286&range=00-01
Stats: 100171 lines in 2710 files changed: 41499 ins; 47639 del; 11033 mod
Patch: https://git.openjdk.org/jdk/pull/23286.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/23286/head:pull/23286
PR: https://git.openjdk.org/jdk/pull/23286
More information about the compiler-dev
mailing list