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

def in constructor invocation causes VerifyError at runtime #5812

Closed
scabug opened this issue May 21, 2012 · 3 comments
Closed

def in constructor invocation causes VerifyError at runtime #5812

scabug opened this issue May 21, 2012 · 3 comments

Comments

@scabug
Copy link

scabug commented May 21, 2012

The following small App causes a VerifyError at runtime. I think the spec (c.f. 5.1.1) should allow this.

object Test extends App {
  class A(x: Int)
  class B extends A({
    def p(x: Int) = x + 1
    p(1)
  })
  new B 
}

The stack trace is

java.lang.VerifyError: (class: Test$B, method: <init> signature: ()V) Expecting to find object/array on stack
	at Test$.<init>(t5812.scala:8)
	at Test$.<clinit>(t5812.scala)
	at Test.main(t5812.scala)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70)
	at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:30)
	at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:138)
@scabug
Copy link
Author

scabug commented May 21, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5812?orig=1
Reporter: Scott Morrison (scott)
Affected Versions: 2.9.2
Duplicates #3832

@scabug
Copy link
Author

scabug commented May 21, 2012

@paulp said:
It's a small variation on #3832.

@scabug
Copy link
Author

scabug commented May 21, 2012

@hubertp said:
True, I had it today in front of my eyes but didn't connect the dots. Thanks Paul.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants