I'm running scala 2.9.1 and on the REPL I get this for as
:
scala> val as = Seq(A1, A2)
as: Seq[ScalaObject with A{def foo(x: Double): Any; val b: B1.type; type MyInnerType >: java.lang.String with Int}] = List(A1$@6da13047, A2$@7168bd8b)
However, when I change it to val as:Seq[A] = Seq(A1, A2)
I get:
scala> val as:Seq[A] = Seq(A1, A2)
as: Seq[A] = List(A1$@6da13047, A2$@7168bd8b)
scala> as foreach { a => a.bar(a.foo(a.b.foo)) }
Sometimes (all the time) scala has trouble inferring types, so you have to annotate what you want. I go to the REPL often to find out what's really going on.