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 #7843: Move LiftTry back to before CapturedVars #7846

Merged
merged 2 commits into from
Dec 25, 2019

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 24, 2019

We need to lift tries before going into CapturedVars since a lifted try
might cause a var to be captured. This means LazyVals now runs after LiftTry,
so we have to account in LiftTry for the fact that the RHS of a lazy val
needs its tries to be lifted.

Fix #7356

We need to lift tries before going into CapturedVars since a lifted try
might cause a var to be captured. This means LazyVals now runs after LiftTry,
so we have to account in LiftTry for the fact that the RHS of a lazy val
needs its tries to be lifted.
Copy link
Member

@smarter smarter left a comment

Choose a reason for hiding this comment

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

LGTM, but #7356 should be closed too, and maybe we should add a comment to indicate that a different scheme for lazy vals would not require this lifting as #7356 (comment) mention.

Add reference to alternate implementation scheme
@odersky odersky merged commit 21d5b07 into scala:master Dec 25, 2019
@odersky odersky deleted the fix-#7843 branch December 25, 2019 10:50
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.

Miscompilation: When a try expression mutating a var is lifted, incorrect code is generated
2 participants