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

Typechecking certain references isn't idempotent #5705

Closed
scabug opened this issue Apr 25, 2012 · 4 comments
Closed

Typechecking certain references isn't idempotent #5705

scabug opened this issue Apr 25, 2012 · 4 comments
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Apr 25, 2012

Sometimes compiler transforms qualified package names into This(). After resetAllAttrs, symbol get lost and there's only an unqualified TypeName left, so the result cannot be typechecked anymore.

@scabug
Copy link
Author

scabug commented Apr 25, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5705?orig=1
Reporter: @xeno-by
Blocks #5464

@scabug
Copy link
Author

scabug commented Dec 6, 2012

@xeno-by said:
See tests introduced in scala/scala@5028181

@scabug
Copy link
Author

scabug commented Jul 16, 2013

Olivier Chafik (ochafik) said:
For what it's worth, here's a hacky workaround that mostly works (needs to be called on the tree before calling resetAllAttrs):

def expandModuleReferences(u: scala.reflect.api.Universe)(tree: u.Tree): u.Tree = {
  import u._
  new Transformer {
    override def transform(tree: Tree) = tree match {
      case Ident() if tree.symbol != null && tree.symbol.isModule && tree.symbol.isStable =>
        getModulePath(u)(tree.symbol.asModule)
      case _ =>
        super.transform(tree)
    }
  }.transform(tree)
}

@scabug scabug added the typer label Apr 7, 2017
@scabug scabug added this to the Backlog milestone Apr 7, 2017
@SethTisue
Copy link
Member

consolidating under #5464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants