On Tue, Jun 12, 2012 at 10:01 PM, Paul Phillips <
pa...@improving.org> wrote:
> The type it is trying to infer (T) itself appears as a type parameter in the
> system it is trying to solve. It responds to this recursion by throwing up
> its hands and putting Any there.
I basically don't understand completely (or misunderstand) what you
mean by recursion. In your original example you had a type parameter
which was bounded by type which contained the type itself, that's what
I understood as the recursion you meant (`trait D[T <: D[T]]`).
Especially looking at the last simplified example I gave it's not
obviously clear to me where there's recursion involved (`trait C[T];
case class D[T](c: C[T])`). Do you mean there's recursion because that
`T` is here constrained (as a more general form of being explicitly
bounded) by something containing `T` itself?
What I'm still wondering about is why extractors are working where
case class constructor matching is not. Is there a deeper cause for
both being handled differently? It seems like extractors would provide
a superset of the functionality of case class matching. (I think I
found a difference: type inference for extractors doesn't allow for
the functionality of "case 2" of the paragraph "Type parameter
inference for typed patterns" in the spec which is to allow
implementing methods like this with pattern matching: `def f[B](t:
Term[B]): B`) Wouldn't it be desirable / possible to unify both?