On Tue, 27 Jan 2026 12:10:22 GMT, Danish Nawab <[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() ||

Whoops -- good catch :-)

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

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

Reply via email to