Why? I don't understand why the place of declatring the type parameters (class / method) changes pattern matching validity.
The difference comes down to the way that pattern type inference replaces method type parameters (by using freeTypesOfTerms
) with fresh type variables when checking of the pattern type and scrutinee type are compatible.
I don't know the rationale for this. I've cc-ed Martin who might be able to help out.
--Thanks,Piotr
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.