You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> case class VCC(x: Int) extends AnyVal
class VCC
scala> val v = VCC(1)
val v: VCC = VCC(1)
scala> v.canEqual(v)
val res0: Boolean = false
scala> v.canEqual(1)
val res1: Boolean = true
scala> v == v
val res2: Boolean = true
Fortunately,
equals
doesn't invokecanEqual
because the class is final (it's a value class) https://github.com/scala/scala/blob/v2.13.14/src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala#L200.The text was updated successfully, but these errors were encountered: