Skip to content

Conversation

@j2rodrig
Copy link
Contributor

When the symbol completer runs, it may create a new Typer instance. But if the current typer is a derived typer the completer won't create an instance of the derived type. This change adds a method "newLikeThis" to the Typer class that can be overridden by derived typers.

if (sym is Module) moduleValSig(sym)
else valOrDefDefSig(original, sym, Nil, Nil, identity)(localContext(sym).setNewScope)
case original: DefDef =>
val typer1 = new Typer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odersky, I'm curious why getting a signature of a DefDef requires creating a new Typer\Namer, while ValDefs and TypeDefs are fine using existing one?

@odersky
Copy link
Contributor

odersky commented Feb 18, 2016

LGTM

odersky added a commit that referenced this pull request Feb 18, 2016
Change nested typer creation to allow creation of derived typers
@odersky odersky merged commit 3c85915 into scala:master Feb 18, 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.

4 participants