RFR: bug: no warning shown for parameterized conversions [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Mon Mar 7 17:15:37 UTC 2022


On Sat, 5 Mar 2022 05:29:53 GMT, Vicente Romero <vromero at openjdk.org> wrote:

>> no warning is shown for parameterized conversions
>
> Vicente Romero has updated the pull request incrementally with one additional commit since the last revision:
> 
>   adding more test cases

I'm not too convinced by this fix. Using warnStack seems really a workaround, and, on top of my head, I can't think of other code doing this.
IMHO, universal vars introduce a new relation between types: `isBoundedBy`. What you want here is, essentially, a form to do `isBoundedByUnchecked` which should do strict check, followed by a looser one (like isSubtypeUnchecked does).
There are many ways to do this, but it feels that having a better separation between these different routines could be, in the long term, a simplifying move (even if, in the short term it will create some code duplication). Because then we can fix the callsites to use the relationship we think is correct, depending on the case.

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

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



More information about the valhalla-dev mailing list