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

VerifyError/Compiler crash with FatalError for "new Unit/new Int/..."

    Details

      Description

      This is a regression in 2.10 trunk. It works in 2.9.2 and earlier.

      scala> new Int
      error: Cannot instantiate Intof kind: INT
      error: 
           while compiling:  <console>
             current phase:  icode
           library version:  version 2.10.0-20120413-153403-c26ef91048
          compiler version:  version 2.10.0-20120413-153403-c26ef91048
        reconstructed args:  
      
      uncaught exception during compilation: scala.reflect.internal.FatalError
      scala.reflect.internal.FatalError: 
           while compiling:  <console>
             current phase:  icode
           library version:  version 2.10.0-20120413-153403-c26ef91048
          compiler version:  version 2.10.0-20120413-153403-c26ef91048
        reconstructed args:  
      
      Cannot instantiate Intof kind: INT
      	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:44)
      	at scala.tools.nsc.Global.abort(Global.scala:193)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:823)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:167)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:147)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:147)
      	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:111)
      	at scala.collection.immutable.List.foldLeft(List.scala:77)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:147)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:1022)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:115)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      	at scala.collection.immutable.List.foreach(List.scala:77)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:140)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:90)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:71)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      	at scala.collection.immutable.List.foreach(List.scala:77)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:71)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:67)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:63)
      	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:423)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:389)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:383)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:697)
      	at scala.collection.AbstractIterator.foreach(Iterator.scala:1124)
      	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:383)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:56)
      	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1305)
      	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1278)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1272)
      	at scala.tools.nsc.interpreter.IMain.compileSourcesKeepingRun(IMain.scala:455)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compileAndSaveRun(IMain.scala:837)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.compile(IMain.scala:795)
      	at scala.tools.nsc.interpreter.IMain$Request.compile(IMain.scala:968)
      	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:622)
      	at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:589)
      	at scala.tools.nsc.interpreter.ILoop.reallyInterpret$1(ILoop.scala:777)
      	at scala.tools.nsc.interpreter.ILoop.interpretStartingWith(ILoop.scala:831)
      	at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:734)
      	at scala.tools.nsc.interpreter.ILoop.processLine$1(ILoop.scala:598)
      	at scala.tools.nsc.interpreter.ILoop.innerLoop$1(ILoop.scala:605)
      	at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:608)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:911)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:873)
      	at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:873)
      	at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:155)
      	at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:873)
      	at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:79)
      	at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:92)
      	at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:101)
      	at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
      
      scala> new Unit
      java.lang.VerifyError: (class: , method: <init> signature: ()V) Call to wrong initialization method
      	at .<init>(<console>:7)
      	at .<clinit>(<console>)
      	at $print(<console>)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:767)
      	at scala.tools.nsc.interpreter.IMain$Request$$anonfun$15.apply(IMain.scala:1018)
      	at scala.tools.nsc.interpreter.Line.scala$tools$nsc$interpreter$Line$$runAndSetState(Line.scala:41)
      	at scala.tools.nsc.interpreter.Line$$anonfun$2.apply$mcV$sp(Line.scala:47)
      	at scala.tools.nsc.io.package$$anon$2.run(package.scala:19)
      	at java.lang.Thread.run(Thread.java:679)
      
      

      The error message is also missing a space between "... Intof ...".

      1. t5666.check
        0.9 kB
        Simon Ochsenreither
      2. t5666.scala
        0.2 kB
        Simon Ochsenreither

        Activity

        Show
        Simon Ochsenreither added a comment - https://github.com/scala/scala/pull/387
        Hide
        Simon Ochsenreither added a comment -

        Sorry, used the wrong version. This isn't fixed in2.10.0-20120430-094203-cfd037271e, although I wonder how the tests run without failure since the test case was merged in https://github.com/scala/scala/commit/9b50dc0dc2c11990e88a8de045dd6e92a409a0cf ...

        Show
        Simon Ochsenreither added a comment - Sorry, used the wrong version. This isn't fixed in2.10.0-20120430-094203-cfd037271e, although I wonder how the tests run without failure since the test case was merged in https://github.com/scala/scala/commit/9b50dc0dc2c11990e88a8de045dd6e92a409a0cf ...
        Show
        Simon Ochsenreither added a comment - Fixed in https://github.com/scala/scala/commit/e69ee3676dec6023a0d552a6dbabf9ffd29a7111 .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Simon Ochsenreither
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development