-
Notifications
You must be signed in to change notification settings - Fork 21
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
Assigning an instance of an anonymous class to a variable and returning that variable in a super class constructor causes verify error #6957
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6957?orig=1
|
@JamesIry said (edited on Jan 10, 2013 3:12:42 PM UTC): class Foo
class Parent(f:Foo)
class Child extends Parent({val x=new Foo{}; x})
new Child |
@JamesIry said: class Foo
class Parent(f:Foo)
class Child extends Parent({new Foo{}})
new Child and class Foo
class Parent(f:Foo)
class Child extends Parent({val x=new Foo; x})
new Child |
@JamesIry said (edited on Jan 10, 2013 3:43:53 PM UTC): {code}class Child extends Parent({val x=new Foo{}; x}){code}
to the working
|
@JamesIry said: |
instantiating a mixin object, for instance a "new WeakHashMap with SynchronizedMap" inside a code block whose result is used as a super-constructor parameter causes a java.lang.VerifyError. The same code works fine when removing the "with SynchronizedMap" mixin or when calling the code block as a "static" method on a companion object, but when written directly into the super call it fails.
The attached Test.scala App demonstrates this by implementing three subclasses of the same parent class, one for each described variant, and then instantiating them. The third case in the test is the broken one and causes the error upon execution.
The error is "java.lang.VerifyError: (class: Child, method: signature: ()V) Expecting to find object/array on stack"
The text was updated successfully, but these errors were encountered: