inference trouble with recursive generics and raw types

Dan Smith daniel.smith at oracle.com
Tue Nov 5 10:03:46 PST 2013


On Nov 5, 2013, at 4:01 AM, Stephan Herrmann <stephan.herrmann at berlin.de> wrote:

>> Nope, I agree with your explanation (except step (e) should be an eq bound, not a lower bound).
> 
> Oops, really?
> 
> From ⟨Bar<Foo> <: Bar<P#0>⟩, 18.2.3 creates ⟨Foo <= P#0⟩.
> Since neither Foo nor P#0 are wildcards I see 18.2.3 producing ⟨Foo <: P#0⟩,
> further reduced to the bound Foo <: P#0 because P#0 is an inference variable.
> 
> What am I missing?

I'll have some conversations internally about how we feel about the unchecked conversion bug, but here's a response to this part:

This is just the guy who wrote the rules having a blerk moment.  Sorry about that.  Glad you caught it!

It has to be equality -- that's the way subtyping works (see JLS 4.10): List<foo> <: List<bar> implies foo = bar.

—Dan


More information about the lambda-spec-observers mailing list