On Tue, 13 May 2025 09:14:28 GMT, Aggelos Biboudis <abimpou...@openjdk.org> 
wrote:

>> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 725:
>> 
>>> 723: 
>>> 724:     private static boolean isNotValidPair(Class<?> selectorType, 
>>> Object caseLabel) {
>>> 725:         return (selectorType == boolean.class && caseLabel != 
>>> boolean.class && caseLabel != Boolean.class) ||
>> 
>> What happens if `caseLabel` is a reference class? E.g. a `boolean` selector 
>> is incompatible with `String`.
>
> `(selectorType == boolean.class && caseLabel != boolean.class && caseLabel != 
> Boolean.class)` -> true so it is not a valid pair. Do you think it is wrong?

e.g., 
https://github.com/openjdk/jdk/pull/25090/commits/7b030bee3e23206c030970f6c24be3bcb5241361

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25090#discussion_r2086343743

Reply via email to