blob: e4e87654454b3e0cf5e91187064dd4829fff9bb7 (
plain) (
tree)
|
|
trait Covariant[+A]
case class Invariant[A](xs: Array[A]) extends Covariant[A]
class Test {
val arr = Array("abc")
def f[A](v: Covariant[A]) /*inferred!*/ = v match { case Invariant(xs) => xs }
f(Invariant(arr): Covariant[Any])(0) = Nil
}
|