New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VerifyError defining a function in an auxiliary #3832
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3832?orig=1 |
@TiarkRompf said: |
@retronym said (edited on Aug 28, 2013 12:54:48 PM UTC): The lifted method A shorter reproduction: scala> class t3832a {
| def this(un: Int) = {
| this()
| def bippy = this
| ()
| }
| }
defined class t3832a
scala> new t3832a()
java.lang.VerifyError: (class: t3832a, method: bippy$1 signature: ()Lt3832a;) Accessing value from uninitialized register 0 Reverting #1909: diff --git a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
index 515fa66..0185cca 100644
--- a/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
+++ b/src/compiler/scala/tools/nsc/transform/LambdaLift.scala
@@ -436,8 +436,6 @@ abstract class LambdaLift extends InfoTransform {
private def liftDef(tree: Tree): Tree = {
val sym = tree.symbol
val oldOwner = sym.owner
- if (sym.owner.isAuxiliaryConstructor && sym.isMethod) // # bug 1909
- sym setFlag STATIC
sym.owner = sym.owner.enclClass
if (sym.isClass) sym.owner = sym.owner.toInterface
if (sym.isMethod) sym setFlag LIFTED
In lambda lift, we should differentiate between arguments to the self-constructor call and subsequent code in the auxillary constructor. Something similar was done as part of #6666 in explicit outer, see |
@retronym said: |
The following compiles under 2.8 final but throws a VerifyError when instantiated.
See also #1909.
The text was updated successfully, but these errors were encountered: