Skip to content

mark value classes as scala 2 only #2863

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

bishabosha
Copy link
Member

No description provided.

Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Value classes are still a thing in Scala 3. Implicit value classes are typically replaced by extension methods, but not other value classes.

@bishabosha
Copy link
Member Author

bishabosha commented Jul 14, 2023

Value classes are still a thing in Scala 3. Implicit value classes are typically replaced by extension methods

We did plan before in #2812 to promote users to use opaque types in Scala 3, and we also decided in #2768 how to label pages intended to be promoted to scala 2 users.

There's nothing on the page that says it's forbidden to use value classes in Scala 3, the intention is to recommend something else as idiomatic.

Edit: I added a comment to #2812 to include your suggestion

, but not other value classes.

the other value classes are supposed to be replaced by a combination of opaque types and extension methods

@julienrf julienrf merged commit 19b0ca8 into scala:main Jul 17, 2023
@bishabosha bishabosha deleted the port-value-classes branch December 20, 2023 14:49
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants