Skip to content

Fix #8033: Eliminate unnecessary outer accessors #8253

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 5 commits into from
Feb 17, 2020

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Feb 8, 2020

No description provided.

This is a necessary first step to be able to move the field into
the class constructor
@odersky odersky force-pushed the fix-#8033 branch 2 times, most recently from 5cc5ae8 to 4cb1cda Compare February 9, 2020 09:23
The problem is that outer accessors can also be called from outside a class definition,
e.g. as part of pattern matching or type testing. So we have to be more conservative
where to remove them. A drastic measure is to restrict to anonaymous classes only,
which is what this commit does.
We now also drop outer accessors of classes that are visible
only in one toplevel class. This requires counting accessors
in a complete traversal. We therefore need two phases in
separate groups to do the job. The first phase counts, the
second elimintaes accessors using the info gathered in the
first phase.
@odersky odersky marked this pull request as ready for review February 9, 2020 17:15
@odersky odersky merged commit 6da367b into scala:master Feb 17, 2020
@odersky odersky deleted the fix-#8033 branch February 17, 2020 18:00
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.

2 participants