If I execute the following sequence of inputs in both "scala" and
"spark-shell" I see different results:

class Foo
class Bar(val x: Int) extends Foo
val a = Seq[Bar](new Bar(10), new Bar(20), new Bar(30))
def meow(x: Seq[Foo]) = x(0)
meow(a)


Under scala I see the following as expected:

scala> meow(a)
res0: Foo = Bar@7f020a15


Under spark-shell I see this:

scala> meow(a)
<console>:19: error: type mismatch;
 found   : Seq[this.Bar]
 required: Seq[this.Foo]
       meow(a)


It appears that somehow Seq[T] is no longer covariant? I'm sure this
is just some kind of Scala ignorance on my part, but any hints would
be appreciated.

Thanks,
-Jey

Reply via email to