diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-23 16:15:46 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-23 16:16:14 +0200 |
commit | 7b8000914abe73883052b1d8af356f91cc133806 (patch) | |
tree | eca9fd3178e13c65c61dd9ff19f7953c11814a21 /src/dotty/tools/dotc/typer/Namer.scala | |
parent | 66a176bea94205469851fdb4fab46c2589fba407 (diff) | |
download | dotty-7b8000914abe73883052b1d8af356f91cc133806.tar.gz dotty-7b8000914abe73883052b1d8af356f91cc133806.tar.bz2 dotty-7b8000914abe73883052b1d8af356f91cc133806.zip |
Fixes expansion and general handling of pattern defs.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r-- | src/dotty/tools/dotc/typer/Namer.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala index 3b1fb4810..5f6a6528f 100644 --- a/src/dotty/tools/dotc/typer/Namer.scala +++ b/src/dotty/tools/dotc/typer/Namer.scala @@ -59,12 +59,12 @@ class Namer { typer: Typer => import untpd._ - /** A partial map from unexpanded member defs to their expansions. + /** A partial map from unexpanded member and pattern defs and to their expansions. * Populated during enterSyms, emptied during typer. */ - lazy val expandedTree = new mutable.HashMap[MemberDef, Tree] + lazy val expandedTree = new mutable.HashMap[DefTree, Tree] - /** A map from expanded MemberDef or Import trees to their symbols. + /** A map from expanded MemberDef, PatDef or Import trees to their symbols. * Populated during enterSyms, emptied at the point a typed tree * with the same symbol is created (this can be when the symbol is completed * or at the latest when the tree is typechecked. @@ -187,8 +187,8 @@ class Namer { typer: Typer => } /** The expansion of a member def */ - def expansion(mdef: MemberDef)(implicit ctx: Context): Tree = { - val expanded = desugar.memberDef(mdef) + def expansion(mdef: DefTree)(implicit ctx: Context): Tree = { + val expanded = desugar.defTree(mdef) if (expanded ne mdef) expandedTree(mdef) = expanded expanded } @@ -215,7 +215,7 @@ class Namer { typer: Typer => ctx case imp: Import => importContext(createSymbol(imp), imp.selectors) - case mdef: MemberDef => + case mdef: DefTree => expansion(mdef).toList foreach (tree => enterSymbol(createSymbol(tree))) ctx case _ => |