【发布时间】:2013-06-15 18:59:39
【问题描述】:
class Test1(buf:Buffer[AnyRef])
class Test2(buf:Buffer[String]) extends Test(buf)
编译器错误:
type mismatch;
found : scala.collection.mutable.Buffer[String]
required: scala.collection.mutable.Buffer[Any]
Note: org.msgpack.type.Value <: Any, but trait Buffer is invariant in type A. You may wish to investigate a wildcard type such as `_ <: Any`. (SLS 3.2.10)
【问题讨论】:
标签: scala