RFR: 8367530: The exhaustiveness errors could be improved [v4]

Jan Lahoda jlahoda at openjdk.org
Fri Nov 7 13:32:32 UTC 2025


On Tue, 4 Nov 2025 14:14:46 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ExhaustivenessComputer.java line 948:
>> 
>>> 946:                 //combine sealed subtypes into the supertype, if all is covered.
>>> 947:                 //but preserve more specific record types in positions where there are record patterns in the original patterns
>>> 948:                 //this is particularly for the case where the sealed supertype only has one permitted type, the record
>> 
>> There is a word missing:"this is particularly *important* for" I think, right?
>
> Interesting. This is a property for NR-1S that shows up here too. Nice.

Done.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27256#discussion_r2503546791


More information about the compiler-dev mailing list