Scala Programming Language
  1. Scala Programming Language
  2. SI-6677

VerifyError constructing path dependent class

    Details

      Description

      
      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.

        Activity

        Hide
        Jason Zaugg added a comment -

        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

        Show
        Jason Zaugg added a comment - 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
        Show
        Jason Zaugg added a comment - https://github.com/scala/scala/pull/1643
        Hide
        Stefan Zeiger added a comment -

        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 }
        }
        
        Show
        Stefan Zeiger added a comment - 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 } }
        Hide
        Jason Zaugg added a comment - - edited

        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)
        
        Show
        Jason Zaugg added a comment - - edited 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)

          People

          • Assignee:
            Jason Zaugg
            Reporter:
            Jason Zaugg
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development