diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-01-29 13:02:01 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-02 13:19:07 +0100 |
commit | 275b341545a3c4e633bd735cf45ccc1956a4233e (patch) | |
tree | 3f68aa101909b010ec25d70ac7894cde7b746311 /src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala | |
parent | 66fa1f22ac058e87350304388eca17aedc1e4b64 (diff) | |
download | scala-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.scala | 10 |
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) } |