aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/typer/Namer.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-30 14:45:51 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2014-03-31 14:52:40 +0200
commitd173cc048ebdbff30f6537f207118fc5717b8787 (patch)
treedb2ca3232dd3313b49335d72da238f7476f5cb3e /src/dotty/tools/dotc/typer/Namer.scala
parentcac8c752b626bc0a5f872572f8ec07274f5e9e0e (diff)
downloaddotty-d173cc048ebdbff30f6537f207118fc5717b8787.tar.gz
dotty-d173cc048ebdbff30f6537f207118fc5717b8787.tar.bz2
dotty-d173cc048ebdbff30f6537f207118fc5717b8787.zip
Renaming clear->setNew
clear is wrong. E.g. clearTyperState does not clear the typerstate at all. It installs a fresh (i.e. cloned) copy of the previous one. clearScope is also wrong; it installs a new scope, does not clear the current one.
Diffstat (limited to 'src/dotty/tools/dotc/typer/Namer.scala')
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index e81949f05..d0e78185f 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -292,7 +292,7 @@ class Namer { typer: Typer =>
/** A new context for the interior of a class */
def inClassContext(selfInfo: DotClass /* Should be Type | Symbol*/)(implicit ctx: Context): Context = {
- val localCtx: Context = ctx.fresh.clearScope
+ val localCtx: Context = ctx.fresh.setNewScope
selfInfo match {
case sym: Symbol if sym.exists && sym.name != nme.WILDCARD =>
localCtx.scope.asInstanceOf[MutableScope].enter(sym)
@@ -385,14 +385,14 @@ class Namer { typer: Typer =>
private def typeSig(sym: Symbol): Type = original match {
case original: ValDef =>
if (sym is Module) moduleValSig(sym)
- else valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).clearScope)
+ else valOrDefDefSig(original, sym, Nil, identity)(localContext(sym).setNewScope)
case original: DefDef =>
val typer1 = new Typer
nestedTyper(sym) = typer1
typer1.defDefSig(original, sym)(localContext(sym).setTyper(typer1))
case original: TypeDef =>
assert(!original.isClassDef)
- typeDefSig(original, sym)(localContext(sym).clearScope)
+ typeDefSig(original, sym)(localContext(sym).setNewScope)
case imp: Import =>
try {
val expr1 = typedAheadExpr(imp.expr, AnySelectionProto)