The problem is that a is Map[X, Y]not covariant in its type parameter X(but a Vector[X]is).
What does it mean? Suppose B <: A(read, Bis a subtype A).
Vector[B] <: Vector[A]. : X Vector[B], B. , A . ( .)
, Map[X, B] <: Map[X, A] X ( , , ).
Map . , Map[B, X] <: Map[A, X] X.
:
val x: Map[B, X] = ???
x.get(b: B)
val y: Map[A, X] = x
y.get(a: A)
, a Map[_, _] a Map[Any, Any]. , :
case map: Map[_, _] => ...