aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-10-24 13:29:40 +0200
committerMartin Odersky <odersky@gmail.com>2013-10-24 13:29:40 +0200
commit44f0976487792760f0dc7fc8aa3dc1ba4ac52b7f (patch)
treefe17e008d4023ebf5d8387d98c9d441735531b71 /src/dotty/tools/dotc/typer/Namer.scala
parentde336bccbbd5671f97e7889b5260e963c8317b1d (diff)
downloaddotty-44f0976487792760f0dc7fc8aa3dc1ba4ac52b7f.tar.gz
dotty-44f0976487792760f0dc7fc8aa3dc1ba4ac52b7f.tar.bz2
dotty-44f0976487792760f0dc7fc8aa3dc1ba4ac52b7f.zip
Added forgfeotten withNewScope when typing value definitions.
ValDefs need to open a new scope for anything that's declared on the right hand side.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 7582b0d0d..79b1750dc 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -89,7 +89,8 @@ class Namer { typer: Typer =>
/** The scope of the typer.
* For nested typers this is a place parameters are entered during completion
- * and where they survive until typechecking.
+ * and where they survive until typechecking. A context with this typer also
+ * has this scope.
*/
val scope = newScope
@@ -278,7 +279,7 @@ class Namer { typer: Typer =>
def typeSig(tree: Tree): Type = tree match {
case tree: ValDef =>
- valOrDefDefSig(tree, sym, identity)(localContext)
+ valOrDefDefSig(tree, sym, identity)(localContext.withNewScope)
case tree: DefDef =>
val typer1 = new Typer
nestedTyper(sym) = typer1