Skip to content

Fix #4590: Reintroduce old inline accessor scheme as a fallback #4634

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 1 commit into from
Jun 11, 2018

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jun 9, 2018

Turns out things are not so simple. Some inline accessors cannot be handled
in the same way as protected accessors because we cannot always place an accessor
method next to the accessed symbol.

We solve this by using an adapted version of the old inline accessor scheme as a fallback.

Turns out things are not so simple. Some inline accessors cannot be handled
in the same way as protected accessors because we cannot always place an accessor
method next to the accessed symbol.

We solve this by using an adapted version of the old inline accessor scheme as a fallback.
* `TestPassing` class in test `run/inline/inlines_1`:
*
* class C[T](x: T) {
* private[inlines] def next[U](y: U): (T, U) = (x, y)
Copy link
Member

Choose a reason for hiding this comment

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

Is all of this code needed just to create accessors to private-qualified methods? Since they'll end up being public method in the bytecode anyway, maybe we can just relax the accessibility rules inside inlined trees for them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It could also be package private methods in Java classes. Also, in the future we would like to avoid widening protected to public, so it would apply to Scala-defined classes as well.

@odersky odersky merged commit 979d2c7 into scala:master Jun 11, 2018
@allanrenucci allanrenucci deleted the fix-#4590 branch June 11, 2018 12:54
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.

3 participants