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
@som-snytt said:
That depends on your definition of obviously.
As Paul said previously: "A warning might be possible, but it's harder than it looks to warn where you want to without creating spurious warnings elsewhere."
The bug is due to handling case class comparisons like Some. A simpler example:
scala>newSome(1) ==Some(1)
<console>:8:warning: comparing a fresh objectusing `==' will always yield falsenewSome(1) ==Some(1)
^
res1:Boolean=true
I can request a pull with a tweak, after I check all the spurious warnings elsewhere, obviously.
@paulp said:
I already pushed a fix for this, but it can be improved. Also, the world of name mangling bugs became more interesting recently with #5652, if you didn't see that one.
The result make the warning obviously wrong:
scala> case class C(val s: Int*)
defined class C
scala> new C(1, 3, 7) == new C(1, 3, 7)
:10: warning: comparing a fresh object using `==' will always yield false
new C(1, 3, 7) == new C(1, 3, 7)
^
res4: Boolean = true
The text was updated successfully, but these errors were encountered: