Permalink
Browse files

SI-7345 Use combinator to find next enclosing non-template.

  • Loading branch information...
1 parent 281b850 commit b1cb00456e6ff545a4c6b8e8d1fe32823e832418 @retronym retronym committed Apr 9, 2013
Showing with 1 addition and 3 deletions.
  1. +1 −3 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

0 comments on commit b1cb004

Please sign in to comment.