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

Aggelos Biboudis abimpoudis at openjdk.org
Tue Nov 4 16:12:46 UTC 2025


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

>> Jan Lahoda has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 23 commits:
>> 
>>  - Merge branch 'JDK-8364991' into JDK-8367530
>>  - Fixing tests
>>  - Merge branch 'JDK-8364991-2' into JDK-8367530-2
>>  - Better visualisation.
>>  - Merge branch 'JDK-8367499' into JDK-8367530
>>  - Merge branch 'JDK-8364991' into JDK-8367499
>>  - Fixing tests.
>>  - Cleanup.
>>  - Cleanup.
>>  - Cleanup.
>>  - ... and 13 more: https://git.openjdk.org/jdk/compare/e6a3f0da...b7c33349
>
> 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.

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

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


More information about the compiler-dev mailing list