RFR: 8315134: javac inference seems to be capturing types incorrectly

Maurizio Cimadamore mcimadamore at openjdk.org
Tue Aug 29 10:43:10 UTC 2023


On Tue, 29 Aug 2023 10:37:21 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> But this is unsound.

A "more correct" solution would be to treat the supertype derivation as an inference problem - e.g. posit that given `Foo<?>` that is some supertype `Sup<Foo<alpha>>`, where `alpha` is an inference variable (likely with some `capture` constraints). But, needless to say, this requires a lot of spec (and compiler) work to get right.

Anyway, for the time being, as I suggested last time, I believe the best course of action is to do nothing, and treat this as a "known issue".

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

PR Comment: https://git.openjdk.org/jdk/pull/15463#issuecomment-1697191037


More information about the compiler-dev mailing list