Why `List[B]` is not a subtype of `Seq[L]` when `class B extends A` and `L <: A`?
问题 Having: class A class B extends A It is correct to write: val foo: Seq[A] = List[B](new B) What do I miss while having an error in? def bar[L <: A](): Seq[L] = List[B](new B) Error: [error] found : List[B] [error] required: Seq[L] [error] def t[L <: A](): Seq[L] = List[B](new B) 回答1: The signature of your bar method is essentially saying, tell me some subtype of A and I'll give you a sequence of things of that type. There are potentially a lot of subtypes of A that B is not a subtype of (i.e.