Hey guys,
Running the following code:
trait Foo
class A extends Foo
class B extends Foo
val x = List[Foo](new A(), new B())
works fine in the scala interpreter, but fails in the Spark shell with the following error:
scala> List[Foo](new A(), new B())
<console>:20: error: type mismatch;
found : this.A
required: this.Foo
List[Foo](new A(), new B())
^
<console>:20: error: type mismatch;
found : this.B
required: this.Foo
List[Foo](new A(), new B())
^
Any ideas why this is the case?