RFR: addressing several issues in the implementation of universal tvars [v6]
Vicente Romero
vromero at openjdk.java.net
Tue Jun 7 18:35:28 UTC 2022
On Tue, 7 Jun 2022 14:37:18 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> adding structural type comparator to detect unchecked conversions
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 1171:
>
>> 1169: @Override
>> 1170: public Boolean visitType(Type t, Type s) {
>> 1171: switch (t.getTag()) {
>
> In general - it seems like this routine has been brought in from isSubtype, which I think is wrong. This should borrow the most from isSameType. I believe in the case of this visitor, it would have been ok to simply return true if the two types have same tags? E.g. doesn't seem like adding the `switch` really adds much.
agreed
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 1179:
>
>> 1177: case BOT: case NONE:
>> 1178: return t.hasTag(s.getTag());
>> 1179: case WILDCARD: //we shouldn't be here - avoids crash (see 7034495)
>
> comment seems copy and paste error?
I wasn't sure if this code for wildcards should be there or not, removing it
-------------
PR: https://git.openjdk.java.net/valhalla/pull/684
More information about the valhalla-dev
mailing list