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

Aggelos Biboudis abimpoudis at openjdk.org
Tue May 28 09:01:14 UTC 2024


> 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

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/19361/files
  - new: https://git.openjdk.org/jdk/pull/19361/files/c3143be1..39eb5359

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=19361&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=19361&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/19361.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19361/head:pull/19361

PR: https://git.openjdk.org/jdk/pull/19361


More information about the compiler-dev mailing list