« Return to Thread: parametric types and variance

Re: parametric types and variance

by Miles Sabin :: Rate this Message:

Reply to Author | View in Thread

On Thu, Jul 9, 2009 at 5:37 PM, Christoph Drießen<ced@...> wrote:
> Ok, got it! Thanks Miles!
>
> But Classifier also needs to be contravariant it T. I assume you just forgot
> to change + to - Miles, right?
>
> trait Classifier[-T] {
>  def classify[U <: T](t: U): String
> }

Oops ... yes, quite right.

Cheers,


Miles

--
Miles Sabin
tel: +44 (0)7813 944 528
skype:  milessabin
http://www.chuusai.com/
http://twitter.com/milessabin

 « Return to Thread: parametric types and variance