-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 global init checking crash when using a value defined in by-name closure #22625
base: main
Are you sure you want to change the base?
Conversation
c10505f
to
37e7e2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM, but we should discuss the case where OfClass.outer
is a ValueSet in our next meeting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @q-ata !
None | ||
case _ => | ||
None | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking whether we can simplify resolveEnvByValue
to just return the value for the local variable. We'll probably need two methods, one for mutable, one for immutable. But the logic would be simpler and it'll be easier to handle the TODOs.
That leaves us with the case for lazy local variables, for that one, we can use resolveEnvByOwner
.
If it makes sense, it can be experimented in another PR.
In order to avoid breaking nightly build, I added |
This PR fixes a crash that would occur when analyzing a by-name closure that reads a local value.
This was because the value would have an incorrect
enclosingMethod
field due to the analysis running before by-names are transformed by the elimByName pass.[test_scala2_library_tasty]