Skip to content

Fix lift try and captured vars interaction #758

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

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Aug 15, 2015

Replaces #753. Review by @DarkDimius.

@odersky
Copy link
Contributor Author

odersky commented Aug 15, 2015

Note: This PR uncovered (and fixes) a deeper problem about miniphase assembly which caused a
CapturedVars treetransform to come with an idx of 0, so the system would think tarnsformFollowing needs to run LazyVals on it, so we got NotDefinedHere errors.

@odersky odersky force-pushed the fix-liftedTry-capturedVars-interaction branch from 2a5c446 to 5483088 Compare August 15, 2015 18:12
It can happen that changeOwner sees symbols that are not defined yet at the phase where
the method is run. Such symbols should be ignored.
There were two architectural errors here, which confused TreeTransforms and MiniPhases
and which caused "NotDefinedHere" on transformFollowing:

1. TreeTransforms should not have idx fields, MiniPhases have them.2
2. TreeTransformers initialize arrays of MiniPhases not TreeTransforms.
CapturedVars introduced an assignment that could cause a try to be
executed with a non-empty stack, even after LiftTry had already run.
We now avoid this by introducing a temporary variable.
Checks the hypothesis that lifting a try may safely move expressions
into a ValDef owned by a new temp var.
@odersky odersky force-pushed the fix-liftedTry-capturedVars-interaction branch from 3c69bff to 4ff0636 Compare August 15, 2015 21:38
@odersky
Copy link
Contributor Author

odersky commented Aug 15, 2015

@DarkDimius Can you take a look at what fails here? The PR tests OK locally, but it seems we run out of memory on jenkins. Edit: test commit passes, so it must be in the commits of this PR. Will investigate.

@odersky
Copy link
Contributor Author

odersky commented Aug 17, 2015

/rebuild

@odersky
Copy link
Contributor Author

odersky commented Aug 18, 2015

It was a spurious failure, after all.

@DarkDimius
Copy link
Contributor

Otherwise LGTM

installAfter now overwrites denotaton also when the first denotation of a symbol is defined
after the current phase. Previously, a new denotation with a last valid phase before a first
valid phase was created.
@odersky
Copy link
Contributor Author

odersky commented Aug 20, 2015

@DarkDimius Last two commits ready for review.

@DarkDimius
Copy link
Contributor

LGTM

DarkDimius added a commit that referenced this pull request Aug 20, 2015
…-interaction

Fix lift try and captured vars interaction
@DarkDimius DarkDimius merged commit eec8191 into scala:master Aug 20, 2015
@allanrenucci allanrenucci deleted the fix-liftedTry-capturedVars-interaction branch December 14, 2017 19:20
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