Reputation: 34840
Is this an example of type erasure in Scala?
(None: Option[Int]) == (None: Option[String]) // true
Upvotes: 0
Views: 66
Reputation: 1066
This is the from the scala source:
case object None extends Option[Nothing]
Before erasure both would be None[Nothing]
because only a single instance of None
exists. Yes this is an example of erasure, but not a realy good one.
Upvotes: 2