diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-30 14:45:51 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2014-03-31 14:52:40 +0200 |
commit | d173cc048ebdbff30f6537f207118fc5717b8787 (patch) | |
tree | db2ca3232dd3313b49335d72da238f7476f5cb3e /src/dotty/tools/dotc/core/Contexts.scala | |
parent | cac8c752b626bc0a5f872572f8ec07274f5e9e0e (diff) | |
download | dotty-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/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 8721bc548..4ccc9be73 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -316,7 +316,7 @@ object Contexts { def setPeriod(period: Period): this.type = { this.period = period; this } def setMode(mode: Mode): this.type = { this.mode = mode; this } def setTyperState(typerState: TyperState): this.type = { this.typerState = typerState; this } - def clearTyperState: this.type = setTyperState(typerState.fresh(isCommittable = true)) + def setNewTyperState: this.type = setTyperState(typerState.fresh(isCommittable = true)) def setExploreTyperState: this.type = setTyperState(typerState.fresh(isCommittable = false)) def setPrinterFn(printer: Context => Printer): this.type = { this.printerFn = printer; this } def setOwner(owner: Symbol): this.type = { assert(owner != NoSymbol); this.owner = owner; this } @@ -324,7 +324,7 @@ object Contexts { def setCompilationUnit(compilationUnit: CompilationUnit): this.type = { this.compilationUnit = compilationUnit; this } def setTree(tree: Tree[_ >: Untyped]): this.type = { this.tree = tree; this } def setScope(scope: Scope): this.type = { this.scope = scope; this } - def clearScope: this.type = { this.scope = newScope; this } + def setNewScope: this.type = { this.scope = newScope; this } def setTypeAssigner(typeAssigner: TypeAssigner): this.type = { this.typeAssigner = typeAssigner; this } def setTyper(typer: Typer): this.type = { this.scope = typer.scope; setTypeAssigner(typer) } def setImportInfo(importInfo: ImportInfo): this.type = { this.importInfo = importInfo; this } |