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>caseclassC(x: Int)
// defined case class C
scala>classCC(x: Int) extendsC(x) { overridedefcanEqual(o: Any) = o.isInstanceOf[CC] }
// defined class CC
scala>C(1) ==newCC(1)
valres0:Boolean=true
In Scala 2 the result is false.
The generated equals in Scala 3:
overridedefequals(x$0: Any):Boolean=this.eq(x$0.$asInstanceOf$[Object]).||(
x$0match
{
case x$0@ _:C@unchecked =>this.x.==(x$0.x)
case _ =>false
}
)
while in Scala 2
override <synthetic> defequals(x$1: Any):Boolean=C.this.eq(x$1.asInstanceOf[Object]).||(x$1match {
case (_: C) =>truecase _ =>false
}.&&({
<synthetic> valC$1:C= x$1.asInstanceOf[C];
C.this.x.==(C$1.x).&&(C$1.canEqual(C.this))
}))
The text was updated successfully, but these errors were encountered:
In Scala 2 the result is
false
.The generated
equals
in Scala 3:while in Scala 2
The text was updated successfully, but these errors were encountered: