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

Equals in scalagen is wrong #936

Closed
matteuan opened this issue Nov 14, 2018 · 3 comments
Closed

Equals in scalagen is wrong #936

matteuan opened this issue Nov 14, 2018 · 3 comments

Comments

@matteuan
Copy link

I'm using the release 0.5.1 with generated scala classes. The generation of equals add this to the code:

 if (other == this) {
        return true;
 }

This is correct in Java, but doesn't work in Scala, since == is the same as equals. This problem creates an infinite loop of comparisons that produces StackOverflow.

@joelittlejohn
Copy link
Owner

Interesting. So I guess the scalagen conversion should convert == in Java to eq in Scala.

@matteuan
Copy link
Author

Yes, I guess it should be like that

@joelittlejohn
Copy link
Owner

Superseded by #1199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants