Integrated: cleaning up overload resolution code

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Feb 15 09:34:39 UTC 2022


On Tue, 15 Feb 2022 04:54:02 GMT, Vicente Romero <vromero 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.

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

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



More information about the valhalla-dev mailing list