summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-04-16 09:31:19 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-04-21 13:05:27 +0200
commit78e7ebab7d8acce2632c7ba6a63546cc174e1467 (patch)
tree435f7758470b9c577900d9263ce4df80f1969c4a /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parent7ce4de49c62258356cb84593f623e38bcefe7f22 (diff)
downloadscala-78e7ebab7d8acce2632c7ba6a63546cc174e1467.tar.gz
scala-78e7ebab7d8acce2632c7ba6a63546cc174e1467.tar.bz2
scala-78e7ebab7d8acce2632c7ba6a63546cc174e1467.zip
SI-7345 Refactor manual iteration to use foreach.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index fd15d9f675..a585c24fb1 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -99,13 +99,11 @@ trait Contexts { self: Analyzer =>
}
def resetContexts() {
- var sc = startContext
- while (sc != NoContext) {
- sc.tree match {
+ startContext.enclosingContextChain foreach { context =>
+ context.tree match {
case Import(qual, _) => qual setType singleType(qual.symbol.owner.thisType, qual.symbol)
case _ =>
}
- sc = sc.outer
}
}