aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotty/tools')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala5
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala2
2 files changed, 4 insertions, 3 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
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 840bee467..5b79c62f3 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -806,7 +806,7 @@ class Typer extends Namer with Applications with Implicits {
case tree: untpd.Bind => typedBind(tree, pt)
case tree: untpd.ValDef =>
if (tree.isEmpty) tpd.EmptyValDef
- else typedValDef(tree, sym)(localContext)
+ else typedValDef(tree, sym)(localContext.withNewScope)
case tree: untpd.DefDef =>
val typer1 = nestedTyper.remove(sym).get
typer1.typedDefDef(tree, sym)(localContext.withTyper(typer1))