On Tue, 12 Mar 2024 14:06:11 GMT, Aggelos Biboudis <abimpou...@openjdk.org> 
wrote:

> In cases where the compiler needs to unbox a `long`, `float`, `double` and 
> then run the exactness check, we were getting a crash. While the selector 
> value is always boxed, the type (which controls the execution flow) was not, 
> because the `selectorType` was wrong. This PR addresses this bug.

test/langtools/tools/javac/patterns/PrimitivePatternsSwitch.java line 121:

> 119:         assertEquals(Float.MAX_VALUE, 
> testUnboxingAndWideningFloat(Float.MAX_VALUE));
> 120:         assertEquals(Float.MAX_VALUE, 
> testUnboxingAndWideningFloatExplicitCast(Float.MAX_VALUE));
> 121:         assertEquals(42f, testUnboxingAndWideningLong(42l));

Suggestion:

        assertEquals(42f, testUnboxingAndWideningLong(42L));

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18236#discussion_r1527165787

Reply via email to