summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-01-29 13:02:01 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-02-02 13:19:07 +0100
commit275b341545a3c4e633bd735cf45ccc1956a4233e (patch)
tree3f68aa101909b010ec25d70ac7894cde7b746311 /src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
parent66fa1f22ac058e87350304388eca17aedc1e4b64 (diff)
downloadscala-275b341545a3c4e633bd735cf45ccc1956a4233e.tar.gz
scala-275b341545a3c4e633bd735cf45ccc1956a4233e.tar.bz2
scala-275b341545a3c4e633bd735cf45ccc1956a4233e.zip
SI-6666 Catch VerifyErrors in the making in early defs.
As we did for self/super calls, add a backstop into explicitouter and lambdalift to check when we try to get an outer pointer to an under-construction instance.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
index a86d8aa2d6..0575254c26 100644
--- a/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
+++ b/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala
@@ -269,10 +269,10 @@ abstract class ExplicitOuter extends InfoTransform
}
- /** The stack of constructor symbols in which a call to this() or to the super
- * constructor is active.
+ /** 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 exists (_.owner == clazz)
+ 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
@@ -292,8 +292,8 @@ abstract class ExplicitOuter extends InfoTransform
}
case _ =>
}
- if (treeInfo isSelfOrSuperConstrCall tree) // TODO also handle (and test) (treeInfo isEarlyDef tree)
- inSelfOrSuperCall(currentOwner)(super.transform(tree))
+ if ((treeInfo isSelfOrSuperConstrCall tree) || (treeInfo isEarlyDef tree))
+ inSelfOrSuperCall(currentOwner.owner)(super.transform(tree))
else
super.transform(tree)
}