On Tue, 27 Jan 2026 11:50:01 GMT, Maurizio Cimadamore <[email protected]> 
wrote:

> During speculative attribution of lambda expressions, we might get to the 
> unary/binary op resolution code with erroneous types.
> When this happens, type class witness resolution fails if Numerical/Integral 
> are tweaked to contain witness methods.
> 
> This PR fixes this condition and adds a test.

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Operators.java line 594:

> 592:         public boolean test(Env<AttrContext> env, Type arg1, Type arg2) {
> 593:             if (types.unboxedTypeOrType(arg1).isPrimitive() ||
> 594:                     types.unboxedTypeOrType(arg1).isPrimitive() ||

`types.unboxedTypeOrType(arg1).isPrimitive()` is repeated twice. Perhaps the 
intention was to check arg**2** instead?

Suggestion:

            if (types.unboxedTypeOrType(arg1).isPrimitive() ||
                    types.unboxedTypeOrType(arg2).isPrimitive() ||

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1981#discussion_r2731714581

Reply via email to