Skip to content
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

Passing self-reference to varargs super constructor causes VerifyError #6928

Closed
scabug opened this issue Jan 6, 2013 · 4 comments
Closed

Passing self-reference to varargs super constructor causes VerifyError #6928

scabug opened this issue Jan 6, 2013 · 4 comments

Comments

@scabug
Copy link

@scabug scabug commented Jan 6, 2013

According to PaulP, this is "another variation on #473 (and later, #3913)" -- code compiles but causes a VerifyError when loaded.

Welcome to Scala version 2.10.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0).
Type in expressions to have them evaluated.
Type :help for more information.

scala> abstract class A( val someAs: A* )
defined class A

scala> object B extends A(B)
defined module B

scala> B.someAs
java.lang.VerifyError: (class: B$, method: signature: ()V) Expecting to find object/array on stack

When I pass in a Set rather than a varargs list, I get a reasonable error:

scala> abstract class A( val someAs: Set[A] )
defined class A

scala> object B extends A(Set(B))
:11: error: super constructor cannot be passed a self reference unless parameter is declared by-name
object B extends A(Set(B))

@scabug
Copy link
Author

@scabug scabug commented Jan 6, 2013

Imported From: https://issues.scala-lang.org/browse/SI-6928?orig=1
Reporter: Nicholas Sterling (amigonico)
Affected Versions: 2.10.0

@scabug
Copy link
Author

@scabug scabug commented Jan 6, 2013

@scabug
Copy link
Author

@scabug scabug commented Jan 9, 2013

@gkossakowski said:
From mailing list:

By the way, 2.10.0 was not in the Affects Version/s pulldown, so I put 2.10.0-RC5.

It's there now so I fixed that.

@scabug
Copy link
Author

@scabug scabug commented Nov 21, 2013

@retronym said:
We forgot to close this ticket after Paul's patch was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants