inference trouble with recursive generics and raw types
stephan.herrmann at berlin.de
Tue Nov 5 10:19:17 PST 2013
On 11/05/2013 07:03 PM, Dan Smith wrote:
> On Nov 5, 2013, at 4:01 AM, Stephan Herrmann <stephan.herrmann at berlin.de> wrote:
>> 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.
> It has to be equality -- that's the way subtyping works (see JLS 4.10): List<foo> <: List<bar> implies foo = bar.
So, since reduction happens in several steps (via the type argument containment),
which step needs correcting? Drop the type argument containment and go
directly to equality? In that case type argument containment constraints
seem to be unused in the spec, right?
More information about the lambda-spec-experts