RFR: addressing review comments [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Mar 3 10:49:27 UTC 2022


On Wed, 2 Mar 2022 21:00:03 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   additional test and bug fix
>
> 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.

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

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



More information about the valhalla-dev mailing list