RFR: bug: no warning shown for parameterized conversions [v4]
Vicente Romero
vromero at openjdk.java.net
Wed Mar 9 14:15:26 UTC 2022
On Wed, 9 Mar 2022 09:55:53 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
>>
>> renaming argument
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java line 2034:
>
>> 2032:
>> 2033: public Type withTypeVar(Type t) {
>> 2034: return t.hasTag(TYPEVAR) && t.isReferenceProjection() && t == projection ?
>
> Uhm - this method is typically used to set type-variables on wildcard types. It is a bit of a corner case in the compiler code, and I think it would be better to leave this alone. What is this code trying to do - and can the same be achieved in another way?
this code is preserving the reference projection of a type var, if it was originally declared as a reference `T.ref`, instead of overriding it with its dual `T`. If the reference projection is not preserved then it leads to information loss. I haven't found another more reliable way
-------------
PR: https://git.openjdk.java.net/valhalla/pull/666
More information about the valhalla-dev
mailing list