Georgii Dernovyi
2016-12-14 16:00:38 UTC
I found that subj returns false for the same object. It is a terrible
mistake for me
case class a(i:Int)
{
override def canEqual(a: Any) = a.isInstanceOf[Int]
override def equals(o:Any) = AnyRef.equals(o)
override def hashCode = AnyRef.hashCode
}
val aa = new a(1)
aa == aa //false
Am I right? )
mistake for me
case class a(i:Int)
{
override def canEqual(a: Any) = a.isInstanceOf[Int]
override def equals(o:Any) = AnyRef.equals(o)
override def hashCode = AnyRef.hashCode
}
val aa = new a(1)
aa == aa //false
Am I right? )
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-language+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.