[code-reflection] RFR: Fix lowering type pattern [v2]

Paul Sandoz psandoz at openjdk.org
Fri Dec 19 22:46:34 UTC 2025


On Fri, 19 Dec 2025 22:32:24 GMT, Mourad Abbay <mabbay at openjdk.org> wrote:

>> src/jdk.incubator.code/share/classes/jdk/incubator/code/dialect/java/JavaOp.java line 4937:
>> 
>>> 4935:             );
>>> 4936:             private static boolean isNarrowingPrimitiveConv(PrimitiveType s, PrimitiveType t) {
>>> 4937:                 return narrowingOrder.get(t) <= narrowingOrder.get(s) && !s.equals(t); // need to be strict, to not consider int -> int as narrowing
>> 
>> Can you replace with `narrowingOrder.get(t) < narrowingOrder.get(s) || !s.equals(t)`?
>
> this way `byte -> int` will be considered narrowing

Ah, yes i see now, got confused on the ordering.

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

PR Review Comment: https://git.openjdk.org/babylon/pull/772#discussion_r2636500075


More information about the babylon-dev mailing list