RFR: addressing several issues in the implementation of universal tvars [v6]
Vicente Romero
vromero at openjdk.java.net
Tue Jun 7 21:04:50 UTC 2022
On Tue, 7 Jun 2022 14:41:50 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 1217:
>
>> 1215: }
>> 1216: }
>> 1217: return isSameType(t, s);
>
> Here you delegate to isSameType... which seems odd - as this is the only place where we do this.
right, fixing it
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java line 1221:
>
>> 1219:
>> 1220: public boolean compareTypeArgsRecursive(Type t, Type s) {
>> 1221: TypePair pair = new TypePair(t, s);
>
> This is typically needed in subtyping routines, to prevent against cases where we could expand terms forever. But in the case of a structural comparison, this can never happen?
with wildcards yes, unless we rewrite the visitor adding a method for wildcards
-------------
PR: https://git.openjdk.java.net/valhalla/pull/684
More information about the valhalla-dev
mailing list