diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-04-09 19:38:11 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-04-21 12:59:46 +0200 |
commit | b1cb00456e6ff545a4c6b8e8d1fe32823e832418 (patch) | |
tree | cd17d2e03765a619a0c432ea5ec8d033760874a7 /src | |
parent | 281b850abc9d0774a8542ff38b6e584b730f2d78 (diff) | |
download | scala-b1cb00456e6ff545a4c6b8e8d1fe32823e832418.tar.gz scala-b1cb00456e6ff545a4c6b8e8d1fe32823e832418.tar.bz2 scala-b1cb00456e6ff545a4c6b8e8d1fe32823e832418.zip |
SI-7345 Use combinator to find next enclosing non-template.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index 0d408c6859..9af9de37e0 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -329,9 +329,7 @@ trait Contexts { self: Analyzer => * accessible. */ def makeConstructorContext = { - var baseContext = enclClass.outer - while (baseContext.tree.isInstanceOf[Template]) - baseContext = baseContext.outer + val baseContext = enclClass.outer.nextEnclosing(!_.tree.isInstanceOf[Template]) val argContext = baseContext.makeNewScope(tree, owner) argContext.restoreState(state) argContext.inSelfSuperCall = true |