Skip to content

Commit 3c85915

Browse files
committed
Merge pull request #1094 from j2rodrig/master
Change nested typer creation to allow creation of derived typers
2 parents 7a893f5 + 697e5e3 commit 3c85915

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/dotty/tools/dotc/typer/Namer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ class Namer { typer: Typer =>
508508
if (sym is Module) moduleValSig(sym)
509509
else valOrDefDefSig(original, sym, Nil, Nil, identity)(localContext(sym).setNewScope)
510510
case original: DefDef =>
511-
val typer1 = new Typer
511+
val typer1 = ctx.typer.newLikeThis
512512
nestedTyper(sym) = typer1
513513
typer1.defDefSig(original, sym)(localContext(sym).setTyper(typer1))
514514
case original: TypeDef =>

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
6868
*/
6969
private var importedFromRoot: Set[Symbol] = Set()
7070

71+
def newLikeThis: Typer = new Typer
72+
7173
/** Attribute an identifier consisting of a simple name or wildcard
7274
*
7375
* @param tree The tree representing the identifier.

0 commit comments

Comments
 (0)