RFR: 8308642: Unhelpful pattern switch error: illegal fall-through to a pattern [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Fri May 31 08:47:07 UTC 2024


On Tue, 28 May 2024 09:01:14 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> Improves two error messages regarding fall-through. Two examples source files after this patch is applied:
>> 
>> 
>>> javac jdk/test/langtools/tools/javac/diags/examples/FlowsThroughFromPattern.java                                                                                                       1m 35s
>> jdk/test/langtools/tools/javac/diags/examples/FlowsThroughFromPattern.java:29: error: illegal fall-through from a pattern
>>             case String str:
>>                  ^
>>   the current case label is missing a break
>> 1 error
>> 
>>> javac jdk/test/langtools/tools/javac/diags/examples/FlowsThroughToPattern.java  
>> jdk/test/langtools/tools/javac/diags/examples/FlowsThroughToPattern.java:30: error: illegal fall-through to a pattern
>>             case Object obj: break;
>>                  ^
>>   the previous case label is missing a break
>> 1 error
>
> Aggelos Biboudis has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review

Marked as reviewed by mcimadamore (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/19361#pullrequestreview-2090204878


More information about the compiler-dev mailing list