Skip to content

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

Development

Successfully merging this pull request may close these issues.

Compiler crash with scala.MatchError: trait mixed into object "_setter_" (dotty.tools.dotc.core.Names$DerivedName) - vals from tuple desugaring

3 participants