Skip to content

Change nested typer creation to allow creation of derived typers #1094

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 1 commit into from
Feb 18, 2016

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.

@@ -508,7 +508,7 @@ class Namer { typer: Typer =>
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