Skip to content

Workaround for existential bind / resetAttrs interaction #19

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

Closed
wants to merge 4 commits into from

Conversation

retronym
Copy link
Member

The original trees for pattern matching Binds are somewhat unusual.

pat = (s#4999 @ (_: Seq#41[_#5000]))
                `------- Typed ---'
      `--------- Bind -------------'

val Typed(_, tpt: TypeTree) = <<(_: Seq#41[_#5000])>>
val AppliedTypeTree(<<scala.Seq#41>>, (arg: TypeTree) :: Nil) = tpt.original
val Bind(_#5000, EmptyTree) = arg.original

This commit manually resets the typed _#5000 to Ident(tpename.WILDCARD).

I'm not sure yet whether scalac ought to present a fully untyped original here.

Review by @phaller

 - Use the continuations plugin from scalaHome, rather than from
   the downloaded dependencies
 - Add a task, `patch-idea`, to run after `gen-idea`. This task updates
   the IntelliJ classpath (and associated sources) to the local copy of Scala.
This helps readers, and IntelliJ, comprehend the code.
Hopefully we can do without this sooner rather than
later, but until then, let's make it a little easier to debug.
The original trees for pattern matching Binds are somewhat unusual.

    pat = (s#4999 @ (_: Seq#41[_#5000]))
                    `------- Typed ---'
          `--------- Bind -------------'

    val Typed(_, tpt: TypeTree) = <<(_: Seq#41[_#5000])>>
    val AppliedTypeTree(<<scala.Seq#41>>, (arg: TypeTree) :: Nil) = tpt.original
    val Bind(_#5000, EmptyTree) = arg.original

This commit manually resets the typed `_#5000` to `Ident(tpename.WILDCARD)`.

I'm not sure yet whether scalac ought to present a fully untyped original here.
@retronym
Copy link
Member Author

retronym commented Jul 2, 2013

About to be superseded by a better fix.

@retronym retronym closed this Jul 2, 2013
@retronym retronym deleted the topic/reset-pain-0 branch July 2, 2013 13:46
retronym added a commit to retronym/async that referenced this pull request Jul 2, 2013
 - Avoid reset + retypecheck, instead hang onto the original types/symbols
 - Eliminated duplication between AsyncDefinitionUseAnalyzer and ExprBuilder
   - Instead, decide what do lift *after* running ExprBuilder
   - Account for transitive references local classes/objects. Still a few issues
     with the way we lift them, so the restrictions haven't been removed yet.
 - Make the execution context an regular implicit parameter of the macro
 - Fixes interaction with existential skolems and singleton types

Fixes scala#6, scala#13, scala#16, scala#17, scala#19, scala#21.
retronym added a commit to retronym/async that referenced this pull request Jul 3, 2013
 - Avoid reset + retypecheck, instead hang onto the original types/symbols
 - Eliminated duplication between AsyncDefinitionUseAnalyzer and ExprBuilder
   - Instead, decide what do lift *after* running ExprBuilder
   - Account for transitive references local classes/objects and lift them
     as needed.
 - Make the execution context an regular implicit parameter of the macro
 - Fixes interaction with existential skolems and singleton types

Fixes scala#6, scala#13, scala#16, scala#17, scala#19, scala#21.
@retronym retronym mentioned this pull request Aug 7, 2013
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.

1 participant