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

Recover Scala 2 semantics for AnyVal under -Ycompile-scala2-library #22533

Closed
hamzaremmal opened this issue Feb 6, 2025 · 0 comments · Fixed by #22536
Closed

Recover Scala 2 semantics for AnyVal under -Ycompile-scala2-library #22533

hamzaremmal opened this issue Feb 6, 2025 · 0 comments · Fixed by #22536
Assignees
Labels
area:scala2-library-tasty Any issue generaing or using the Scala 2 library TASTy area:value-classes Issues tied to value classes. itype:bug

Comments

@hamzaremmal
Copy link
Member

Following yesterday's Core Meeting Decision (#22493 (comment)), the semantics of value classes in Scala 2 and Scala 3 are different (only changes in equals and hashCode). When compiling the common subset of the scala 3 stdlib (scala2 stdlib), we need to recover the old semantics. One way to do it, that doesn't require a compiler change is to define manually the equals and hashCode methods (which is possible in Scala 3, see #22494). I'm not a fan of it is very error-prone. A second approach is to recover the old semantics under the -Ycompile-scala2-library, which is the one I'm adopting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scala2-library-tasty Any issue generaing or using the Scala 2 library TASTy area:value-classes Issues tied to value classes. itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant