From fd7b60ce25278a53defd907ef68edb555c552705 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Fri, 2 Sep 2016 18:14:29 +0200 Subject: Fix stack overflow on recurs in namer --- src/dotty/tools/dotc/typer/Namer.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dotty/tools/dotc/typer/Namer.scala') diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index c6ff64d8d..034a1ff50 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -403,8 +403,8 @@ class Namer { typer: Typer => /** Create top-level symbols for all statements in the expansion of this statement and * enter them into symbol table */ - def indexExpanded(stat: Tree)(implicit ctx: Context): Context = { - def recur(stat: Tree): Context = expanded(stat) match { + def indexExpanded(origStat: Tree)(implicit ctx: Context): Context = { + def recur(stat: Tree): Context = stat match { case pcl: PackageDef => val pkg = createPackageSymbol(pcl.pid) index(pcl.stats)(ctx.fresh.setOwner(pkg.moduleClass)) @@ -415,7 +415,7 @@ class Namer { typer: Typer => importContext(createSymbol(imp), imp.selectors) case mdef: DefTree => val sym = enterSymbol(createSymbol(mdef)) - setDocstring(sym, stat) + setDocstring(sym, origStat) addEnumConstants(mdef, sym) ctx case stats: Thicket => @@ -424,7 +424,7 @@ class Namer { typer: Typer => case _ => ctx } - recur(stat) + recur(expanded(origStat)) } /** Determines whether this field holds an enum constant. -- cgit v1.2.3