RFR: addressing review comments [v2]

Vicente Romero vromero at openjdk.java.net
Thu Mar 3 14:06:32 UTC 2022


On Thu, 3 Mar 2022 10:45:09 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 1692:
>> 
>>> 1690:                     // warnStack.head is != null if we are checking for an assignment, in other cases we should be strict
>>> 1691:                     // the order in the condition below matters
>>> 1692:                     if (warnStack.head != null && allowUniversalTVars && !result) {
>> 
>> using the emptiness of the warnStack as the way to know if we are dealing with an assignment or not seems a bit fragile, another option could be to pass down a boolean all the way down from all invocations, what do you think?
>
> Do you mean, e.g. inside overload resolution, how do we distinguish between when we can apply the "loose" check, and when we need the strict check?
> 
> If so, my feeling here is that as we have isSubtype vs. isSubtypeUnchecked we also need isSameTypes vs. isSameTypesUnchecked and a subtyping routine should call the "correct" isSameTypes visitor/routine.

no by strict I meant `===` instead of accepting Type.ref == Type

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

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



More information about the valhalla-dev mailing list