summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-08-28 15:46:04 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-11 23:22:07 +0200
commitc2dc34640c9fd06abda91266ca21160bb423bf41 (patch)
treeafd02a3a4bfb9d36a584f7038abf34599f3dc4b6 /src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
parent97255e7c4e31614b52f0584a75206fd621198ed4 (diff)
downloadscala-c2dc34640c9fd06abda91266ca21160bb423bf41.tar.gz
scala-c2dc34640c9fd06abda91266ca21160bb423bf41.tar.bz2
scala-c2dc34640c9fd06abda91266ca21160bb423bf41.zip
SI-3832 Extract tracking of under-construction classes to a mixin
In order to reduce the noise in OuterPathTransformer.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala17
1 files changed, 2 insertions, 15 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
index d6a6e027cb..8af95afdec 100644
--- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
@@ -216,7 +216,7 @@ abstract class ExplicitOuter extends InfoTransform
* values for outer parameters of constructors.
* The class provides methods for referencing via outer.
*/
- abstract class OuterPathTransformer(unit: CompilationUnit) extends TypingTransformer(unit) {
+ abstract class OuterPathTransformer(unit: CompilationUnit) extends TypingTransformer(unit) with UnderConstructionTransformer {
/** The directly enclosing outer parameter, if we are in a constructor */
protected var outerParam: Symbol = NoSymbol
@@ -276,16 +276,6 @@ abstract class ExplicitOuter extends InfoTransform
}
- /** The stack of class symbols in which a call to this() or to the super
- * constructor, or early definition is active
- */
- protected def isUnderConstruction(clazz: Symbol) = selfOrSuperCalls contains clazz
- protected val selfOrSuperCalls = mutable.Stack[Symbol]()
- @inline protected def inSelfOrSuperCall[A](sym: Symbol)(a: => A) = {
- selfOrSuperCalls push sym
- try a finally selfOrSuperCalls.pop()
- }
-
override def transform(tree: Tree): Tree = {
val savedOuterParam = outerParam
try {
@@ -299,10 +289,7 @@ abstract class ExplicitOuter extends InfoTransform
}
case _ =>
}
- if ((treeInfo isSelfOrSuperConstrCall tree) || (treeInfo isEarlyDef tree))
- inSelfOrSuperCall(currentOwner.owner)(super.transform(tree))
- else
- super.transform(tree)
+ super.transform(tree)
}
finally outerParam = savedOuterParam
}