Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case class and Proxy equals behaviour in Scala 2.9 is incorrect #4807

Closed
scabug opened this issue Jul 15, 2011 · 6 comments
Closed

Case class and Proxy equals behaviour in Scala 2.9 is incorrect #4807

scabug opened this issue Jul 15, 2011 · 6 comments
Assignees
Milestone

Comments

@scabug
Copy link

@scabug scabug commented Jul 15, 2011

In Scala 2.9 a case class is not equal to itself (even the same instance) if it inherits from Proxy. In Scala 2.8 this is not the case.

The discussion here describes it:
http://stackoverflow.com/questions/6667654/case-classes-and-proxy-behaviour-in-scala-2-9

This is causing us huge trouble as we have to:

  • rewrite any of our case classes that inherit (even indirectly) from Proxy
  • not use any library case classes that have Proxy in their inheritance tree

It has made using case classes a unsafe thing to do unless you are sure nothing they inherit from has Proxy, or will ever have Proxy, in its inheritance tree. What's worse is that this problem is causing our code to fail at runtime in very unexpected ways. If this behaviour is by design the least I would expect is some compiler warnings.

Thanks

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 15, 2011

Imported From: https://issues.scala-lang.org/browse/SI-4807?orig=1
Reporter: David Corcoran (corcorda)
Affected Versions: 2.9.0
Other Milestones: 2.10.0

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Jul 15, 2011

@paulp said:
Definitely not by design. Overall issue looks like it has tricky aspects, but it's never correct that something isn't equal to itself.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Sep 10, 2011

Commit Message Bot (anonymous) said:
(extempore in r25642) Helping Proxy equal itself.

Fix for bumpy proxy equals. Closes #4807, no review.

@scabug scabug closed this Sep 10, 2011
@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 17, 2012

David Corcoran (corcorda) said:
Hi Paul. You fixed this a while ago but the 'Fix Version' is still None. Is that correct? Has this not be included in a release? Thanks

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 18, 2012

@paulp said:
It hasn't been in a released version yet. It should have said "unreleased 2.10" already; I backported it to 2.9.x since you brought it up, so now it will be in 2.9.3 as well.

@scabug

This comment has been minimized.

Copy link
Author

@scabug scabug commented Apr 18, 2012

David Corcoran (corcorda) said:
That's great news. Thanks

@scabug scabug added this to the 2.9.2 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.