Integrated: cleaning up overload resolution code

Vicente Romero vromero at openjdk.java.net
Tue Feb 15 13:52:19 UTC 2022


On Tue, 15 Feb 2022 09:30:44 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Overload resolution cleanup
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java line 1058:
> 
>> 1056:             boolean anyIsPrimitiveClass = found.isPrimitiveClass() || req.isPrimitiveClass();
>> 1057:             return strict ?
>> 1058:                     (anyIsUndetVar && anyIsPrimitiveClass ? false :
> 
> Could this code be simplified if we hacked directly into the subtyping routine? Note that, I believe that would be necessary anyway, because you have to take into account cases like:
> 
> `List<Point> <: List<T?>`
> 
> and, also:
> 
> `List<Point> <: List<? extends T?>`
> 
> So, I think fixing at the level of subtyping/type-containment is what we want here.

sure, I will try this

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

PR: https://git.openjdk.java.net/valhalla/pull/648



More information about the valhalla-dev mailing list