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

VerifyError constructing path dependent class #6677

Closed
scabug opened this issue Nov 17, 2012 · 5 comments
Closed

VerifyError constructing path dependent class #6677

scabug opened this issue Nov 17, 2012 · 5 comments

Comments

@scabug
Copy link

scabug commented Nov 17, 2012

class Test {
  val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
  def error {
    new cm.universe.Traverser // java.lang.VerifyError: (class: Test, method: error signature: ()V) Incompatible object argument for function call
  }

  def okay1 {
    val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
    new cm.universe.Traverser
  }

  def okay2 {
    val cm: reflect.runtime.universe.Mirror = reflect.runtime.currentMirror
    val u: reflect.runtime.universe.type = cm.universe
    new u.Traverser
  }
}

object Test {
  def main(args: Array[String]) {
    new Test().error
    new Test().okay1
    new Test().okay2
  }
}

I'm yet to isolate this from the reflection API, so I don't know if it's a regression.

@scabug
Copy link
Author

scabug commented Nov 17, 2012

Imported From: https://issues.scala-lang.org/browse/SI-6677?orig=1
Reporter: @retronym
Affected Versions: 2.10.0-RC2

@scabug
Copy link
Author

scabug commented Nov 17, 2012

@retronym said:
I need to clean this up a little (formulate a test that is independent from the reflection API / remove the return), but this identifies and fixes the problem in Erasure.

https://github.com/retronym/scala/compare/ticket/6677

@scabug
Copy link
Author

scabug commented Nov 18, 2012

@retronym said:
scala/scala#1643

@scabug
Copy link
Author

scabug commented Feb 19, 2013

@szeiger said:
The following test case still fails in 2.10.0:

object Main extends App {
  class O { class I }
  class W { val o: O = new O }
  class C[E](val e: E)
  new C[W](new W) { new e.o.I }
}

@scabug
Copy link
Author

scabug commented Feb 19, 2013

@retronym said (edited on Feb 19, 2013 7:13:50 PM UTC):
This was tagged with the wrong Fix Version, it's in 2.10.1.

 ~/code/scala2 scala-hash v2.10.1-RC1
[info] downloading http://scala-webapps.epfl.ch/artifacts/db5919a7d3b18be94e79899c2f7e33c535e15a27/pack.tgz ...done.
[info] scala revision from 2013-02-09 06:46:59 -0800 downloaded to /Users/jason/usr/scala-v2.10.0-571-gdb5919a
[warn] v2.10.1-RC failed, using closest available
[info] db5919a7d3 => /Users/jason/usr/scala-v2.10.0-571-gdb5919a
Welcome to Scala version 2.10.1-20130209-064659-db5919a7d3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.

scala> object Test extends App {
     |   class O { class I }
     |   class W { val o: O = new O }
     |   class C[E](val e: E)
     |   new C[W](new W) { new e.o.I }
     | }
defined module Test

scala> Test
res0: Test.type = Test$@7ceb670

scala> Test.main(null)

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