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

Verify Error, expecting to find object/array on stack #4061

Closed
scabug opened this issue Dec 5, 2010 · 3 comments
Closed

Verify Error, expecting to find object/array on stack #4061

scabug opened this issue Dec 5, 2010 · 3 comments
Assignees

Comments

@scabug
Copy link

scabug commented Dec 5, 2010

The following code produces a VerifyError at runtime:

case class ParentType(parameter: String)

object ChildType extends ParentType(ChildType.something) {
  val something = "1.2.3.4"
}

object Main {
  def main(args: Array[String]): Unit = {
    println(ChildType) // <- That's line 9
  }
}

This is the interesting part of the error:

java.lang.VerifyError: (class: ChildType$$, method: <init> signature: ()V) Expecting to find object/array on stack
        at Main$$.main(Main.scala:9)
        at Main.main(Main.scala)

In my opinion scalac should correctly compile this (= allow SubType to be derived from ParentType and passing the value of 'something' directly to ParentType upon it's creation).

Versions in use:
Scala: 2.8.1, 2.8.0, 2.7.7
Java: 1.6.0_18, 64 Bit Server VM, OpenJDK
Operating system: Linux, Fedora 12, 64 Bit

This issue was reported on the scala-user mailing list:
http://www.scala-lang.org/node/8328

There is a similar issue already in trac: #3913

@scabug
Copy link
Author

scabug commented Dec 5, 2010

Imported From: https://issues.scala-lang.org/browse/SI-4061?orig=1
Reporter: phdoerfler

@scabug
Copy link
Author

scabug commented Dec 5, 2010

@hubertp said:
Since r23222 this is a compiler error:

test.scala:3: error: super constructor cannot be passed a self reference unless parameter is declared by-name
object ChildType extends ParentType(ChildType.something) {
                 ^
one error found

Paul can you comment if this is intended for this ticket as well (and close the bug) or reassign to the meeting, please?

@scabug
Copy link
Author

scabug commented Dec 6, 2010

@paulp said:
Oh, excellent. When I saw the ticket I thought "oh man, not this again." And happily, it is not this again. Already fixed, dup #3913.

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