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

Implement non-local returns #748

Merged
merged 7 commits into from
Aug 9, 2015

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Aug 5, 2015

Implement non-local returns and lift try expressions as necessary. Also, fix previous -Ycheck:labelDef failure by picking a different naming scheme for local dummies.

Closes #742, #743, and #747.

Review by @DarkDimius

Non-local returns are now implemented.
Disable the check because if fails for desugar.scala and also in some dotty files.
This test failed before the addition of NonLocalReturns.
After erasure, if required conformance is between value and non-value types,
one should perform boxing and unboxing operations automatically, instead of
just issuing a cast, which would be illegal at that point.

Also: make isNonLocalReturn available as part of a global object, because
we'll need it in LiftTry.
Phase lifts tries that would be illegal because they execute on non-empty
expression stacks.
@odersky
Copy link
Contributor Author

odersky commented Aug 8, 2015

@DarkDimius Adding this as a post-condition is also not straightforward. I'd probably leave it as it is for now.

@odersky
Copy link
Contributor Author

odersky commented Aug 9, 2015

I am going to merge now, because the PR contains a crucial fix for master. As it stands, master does not pass the tests (on my machine) because of the illegal name problem after labelDefs. Another question that needs to be investigated is why the checkin tests pass - they should fail as well!

odersky added a commit that referenced this pull request Aug 9, 2015
@odersky odersky merged commit 9eb55f1 into scala:master Aug 9, 2015
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.

Need a new phase, that will lift try bodies
2 participants