diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-09-02 18:14:29 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-10-02 16:11:21 +0200 |
commit | fd7b60ce25278a53defd907ef68edb555c552705 (patch) | |
tree | d7b44e5c367c9690829d5f141b2f1c65b4d12aea /src/dotty | |
parent | a75fee22fdff75dd9ebc2faa008e0ec9a82af1fb (diff) | |
download | dotty-fd7b60ce25278a53defd907ef68edb555c552705.tar.gz dotty-fd7b60ce25278a53defd907ef68edb555c552705.tar.bz2 dotty-fd7b60ce25278a53defd907ef68edb555c552705.zip |
Fix stack overflow on recurs in namer
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 8 |
1 files changed, 4 insertions, 4 deletions
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. |