RFR: 8367530: The exhaustiveness errors could be improved [v16]
Maurizio Cimadamore
mcimadamore at openjdk.org
Tue Feb 3 11:11:20 UTC 2026
On Wed, 28 Jan 2026 18:48:58 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> test/langtools/tools/javac/patterns/ExhaustivenessConvenientErrors.java line 333:
>>
>>> 331: case Root(R2 _, R2(R1 _, R2 _), R2(R1 _, R1 _)) -> 0;
>>> 332: case Root(R2 _, R2(R1 _, R2 _), R2(R1 _, R2 _)) -> 0;
>>> 333: // case Root(R2 _, R2(R1 _, R2 _), R2(R2 _, R1 _)) -> 0;
>>
>> it could be confusing to have commented code in a test, I guess probably to just remove the commented code?
>
> These commented-out cases are the ones that are missing from the switch to be exhaustive. I kept them there intentionally, so see what the user might have missed, so that it can be compared with what javac reports. I can add comments to them if desired.
I'm ok with these comments -- I'm a bit less ok with the ones that say "this might be better in this form" -- either we file these case as follow up bugs, or we might as well remove the comments, as I don't think a comment in a test is the best way to track issues/further improvements
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2758531330
More information about the compiler-dev
mailing list