这是 Scala 中类型擦除的一个例子吗?

Is this an example of type erasure in Scala?

这是 Scala 中类型擦除的例子吗?

(None: Option[Int]) == (None: Option[String]) // true

这是来自 Scala 源代码的: case object None extends Option[Nothing]

在擦除之前两者都是 None[Nothing] 因为只有一个 None 存在。是的,这是一个擦除的例子,但不是一个很好的例子。