Skip to content

Fix #10285: Fix scheme for handling setter names #10584

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

Merged
merged 2 commits into from
Dec 2, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 1, 2020

No description provided.

@odersky
Copy link
Contributor Author

odersky commented Dec 1, 2020

This is a WIP that needs help to be pushed over the finish line.

I addressed the immediate problem with confusion between setters and unique names in this commit. The idea is to create a semantic setter name that composes correctly with the other names.

But now the task is to use this to simulate Scala-2's handling of getters, setters and fields for this. And I just can't make sense of it, even after studying Scala-2 generated code at some length of time. So, I propose @sjrd to take this up again. If you have questions how semantic names work I am happy to answer them. But I believe the current problems lie with understanding what exactly Scala 2 does here (at least for me that seems to be the case).

EDIT: I think I got it to work. Let's see what the CI says.

…ived names

Adding "_=" to the last part of a name does not work if that name is a unique name
or other derived name, since the resulting name would print like `x_=$1` instead
of `x$1_=`. Use a new semantic name for synthetic setter suffix instead.
@odersky odersky marked this pull request as ready for review December 1, 2020 21:59
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.

Very nice :)

@odersky odersky merged commit ca71de8 into scala:master Dec 2, 2020
@odersky odersky deleted the fix-#10285 branch December 2, 2020 14:14
@Kordyjan Kordyjan added this to the 3.0.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants