Skip to content

Late expansion fixes #151

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
merged 3 commits into from
Jan 19, 2016
Merged

Conversation

retronym
Copy link
Member

Fixes for the async transform when invoked after pattern's have been translated.

Followup to #141

Avoids mixing in all the specialized apply variants.

We could go further and create an base class for all state machines,
but that would require scala-async to be on the runtime classpath,
which currently isn't a requirement.  For now, I'm keeping it this
way.
  - Detect cross-state symbol references where the RefTree is nested
    in a LabelDef. Failure to do so led to ill-scoped local variable
    references which sometimes manifest as VerifyErrors.
  - Emit a default case in the Match intended to be a tableswitch.
    We have to do this ourselves if we expand after pattern matcher
  - Cleanup generated code to avoid redundant blocks
  - Avoid unnecessary `matchRes` temporary variable for unit-typed
    pattern matches
  - Fix the trace level logging in the ANF transform to restore
    indented output.
  - Emit `{ state = nextState; ... }` rather than
    `try { ... } finally { state = nextState }` in state handlers.
    This simplifies generated code and has the same meaning, as the
    code in the state machine isn't reentrant and can't observe the
    "early" transition of the state.
@retronym retronym added this to the 0.9.6 milestone Jan 19, 2016
retronym added a commit that referenced this pull request Jan 19, 2016
@retronym retronym merged commit 4395afe into scala:master Jan 19, 2016
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.

2 participants