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 with implicit objects #473
Comments
Imported From: https://issues.scala-lang.org/browse/SI-473?orig=1 |
@dragos said: |
@dragos said: |
@paulp said: case class Foo(x: Foo)
case object Bar extends Foo(null)
case object Quux extends Foo(Bar)
case object Voop extends Foo(Voop) This will compile fine, but the self-referential object triggers the same error: scala> Bar
res0: Bar.type = Bar
scala> Quux
res1: Quux.type = Quux
scala> Voop
java.lang.VerifyError: (class: Voop$$, method: <init> signature: ()V) Expecting to find object/array on stack |
@odersky said: |
@paulp said: |
The following code compiles but upon being run produces a VerifyError:
package test;
class Foo(implicit val foo : Foo);
object Test extends Application{
implicit object Bar extends Foo;
Bar.foo
}
java.lang.VerifyError: (class: test/Test$$Bar$$, method: signature: ()V) Expecting to find object/array on stack
at test.Test$$.(test.scala:7)
at test.Test$$.(test.scala)
at test.Test.main(test.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.ObjectRunner$$$$anonfun$$run$$1.apply(ObjectRunner.scala:75)
at scala.tools.nsc.ObjectRunner$$.withContextClassLoader(ObjectRunner.scala:49)
at scala.tools.nsc.ObjectRunner$$.run(ObjectRunner.scala:74)
at scala.tools.nsc.MainGenericRunner$$.main(MainGenericRunner.scala:161)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
The problem exists in both 2.6.1 and 2.7.0-RC1.
The text was updated successfully, but these errors were encountered: