让我们测试简单的构造:
case class ListRef (list : List[_]) extends ref.WeakReference(list)
它给出了错误:
<console>:8: error: illegal inheritance;
self-type ListRef does not conform to scala.ref.WeakReference[List[_$1]]'s selftype scala.ref.WeakReference[List[_$1]]
case class ListRef (list : List[_]) extends WeakReference(list)
这是什么意思,如何逃脱?