Skip to content
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

Fix hoisting local symbols #14714

Merged
merged 1 commit into from Mar 21, 2022
Merged

Fix hoisting local symbols #14714

merged 1 commit into from Mar 21, 2022

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 19, 2022

The previous algorithm computed a "logical owner" of term-owned symbols
from dependencies. But it would switch back from the computed logical
owner to the enclosing class under certain conditions. The problem is
that such a decision cannot be done independently for each symbol, since
it also affects dependent symbols. We now move this distinction into
the logical owner initialization itself, instead of doing it as a
post processing step.

Fixes #14707

The previous algorithm computed a "logical owner" of term-owned symbols
from dependencies. But it would switch back from the computed logical
owner to the enclosing class under certain conditions. The problem is
that such a decision cannot be done independently for each symbol, since
it also affects dependent symbols. We now move this distinction into
the logical owner initialization itself, instead of doing it as a
post processing step.

Fixes scala#14707
Copy link
Member

@dwijnand dwijnand left a comment

Choose a reason for hiding this comment

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

Looks reasonable to me, but I've never looked at this code before.

@odersky odersky merged commit 347a730 into scala:main Mar 21, 2022
@odersky odersky deleted the fix-14707 branch March 21, 2022 10:50
@odersky
Copy link
Contributor Author

odersky commented Mar 21, 2022

Yes, lambdaLift is terra incognita for many, even though it performs a crucial function. I believe @DarkDimius was the only other person who ever worked on it (the code I touched was written originally by him).

@odersky
Copy link
Contributor Author

odersky commented Mar 21, 2022

If people want to learn some of the key steps of compiling Scala, lambdaLift is not a bad start.

@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 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 assertion error: asTerm called on not-a-Term val <none>
3 participants