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

Spurious errors when compiling the Scala library, depending on the file order

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Scala 2.10.0-M2
    • Component/s: None
    • Labels:
      None

      Description

      The compiler crashes with the following error in the backend (an overloaded type reaches backend):

      error: Unknown type: (x: Object, y: Object)Boolean <and> (x$1: Object)Boolean, (x: Object, y: Object)Boolean <and> (x$1: Object)Boolean [class scala.reflect.internal.Types$OverloadedType, class scala.reflect.internal.Types$OverloadedType] TypeRef? false
      error: 
           while compiling:  /Users/dragos/workspace/git/scala/src/library/scala/xml/pull/XMLEventReader.scala
             current phase:  jvm
           library version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
          compiler version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
        reconstructed args:  -classpath lib/fjbg.jar:lib/ant/ant.jar:lib/msil.jar -verbose -d /tmp
      
      uncaught exception during compilation: scala.reflect.internal.FatalError
      error: scala.reflect.internal.FatalError: 
           while compiling:  /Users/dragos/workspace/git/scala/src/library/scala/xml/pull/XMLEventReader.scala
             current phase:  jvm
           library version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
          compiler version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
        reconstructed args:  -classpath lib/fjbg.jar:lib/ant/ant.jar:lib/msil.jar -verbose -d /tmp
      
      Unknown type: (x: Object, y: Object)Boolean <and> (x$1: Object)Boolean, (x: Object, y: Object)Boolean <and> (x$1: Object)Boolean [class scala.reflect.internal.Types$OverloadedType, class scala.reflect.internal.Types$OverloadedType] TypeRef? false
      	at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:38)
      	at scala.tools.nsc.Global.abort(Global.scala:191)
      	at scala.tools.nsc.backend.icode.TypeKinds$class.toTypeKind(TypeKinds.scala:397)
      	at scala.tools.nsc.backend.icode.ICodes.toTypeKind(ICodes.scala:25)
      	at scala.tools.nsc.backend.jvm.GenJVMUtil$BytecodeUtil$class.javaType(GenJVMUtil.scala:100)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaType(GenJVM.scala:183)
      	at scala.tools.nsc.backend.jvm.GenJVMUtil$BytecodeUtil$class.javaType(GenJVMUtil.scala:109)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.javaType(GenJVM.scala:183)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genCallMethod$1(GenJVM.scala:1270)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genBlock$1$1.apply(GenJVM.scala:1393)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genBlock$1$1.apply(GenJVM.scala:1313)
      	at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34)
      	at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:38)
      	at scala.tools.nsc.backend.icode.BasicBlocks$BasicBlock.foreach(BasicBlocks.scala:184)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlock$1(GenJVM.scala:1313)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genBlocks$1(GenJVM.scala:1181)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genCode(GenJVM.scala:1784)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genMethod(GenJVM.scala:940)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genClass$3.apply(GenJVM.scala:465)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator$$anonfun$genClass$3.apply(GenJVM.scala:465)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      	at scala.collection.immutable.List.foreach(List.scala:77)
      	at scala.tools.nsc.backend.jvm.GenJVM$BytecodeGenerator.genClass(GenJVM.scala:465)
      	at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:165)
      	at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase$$anonfun$run$3.apply(GenJVM.scala:164)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)
      	at scala.collection.immutable.List.foreach(List.scala:77)
      	at scala.tools.nsc.backend.jvm.GenJVM$JvmPhase.run(GenJVM.scala:164)
      	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1307)
      	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1280)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1274)
      	at scala.tools.nsc.Global$Run.compile(Global.scala:1404)
      	at scala.tools.nsc.Driver.doCompile(Driver.scala:31)
      	at scala.tools.nsc.Main$.doCompile(Main.scala:81)
      	at scala.tools.nsc.Driver.process(Driver.scala:52)
      	at scala.tools.nsc.Driver.main(Driver.scala:65)
      	at scala.tools.nsc.Main.main(Main.scala)
      
      error: fatal error: 
           while compiling:  /Users/dragos/workspace/git/scala/src/library/scala/xml/pull/XMLEventReader.scala
             current phase:  jvm
           library version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
          compiler version:  version 2.10.0-SNAPSHOT-20120319-00000000-78c15103d5
        reconstructed args:  -classpath lib/fjbg.jar:lib/ant/ant.jar:lib/msil.jar -verbose -d /tmp
      

      The error appears and goes away depending on the order in which files are compiled. I can reproduce it by compiling together everything under 'src/library', in the order listed in the attached file. Run it with
      scalac -d /tmp @sources-lib.

      Sorry I cannot narrow it down more than this, but I hope it's enough to get someone to look at it. It's a blocker for anyone trying to build the Scala library in the IDE (or it may not, depending on the order in which it happens to build those files).

        Activity

        Hide
        Iulian Dragos added a comment -

        What a team! (Paul does the work, and we cheer on the side!) Thanks a lot.

        Show
        Iulian Dragos added a comment - What a team! (Paul does the work, and we cheer on the side!) Thanks a lot.
        Hide
        Paul Phillips added a comment -

        Just glad to be on the field.

        Show
        Paul Phillips added a comment - Just glad to be on the field.
        Hide
        Iulian Dragos added a comment -

        It's great to have you on the team.

        Show
        Iulian Dragos added a comment - It's great to have you on the team.
        Hide
        Paul Phillips added a comment -

        Stop, you'll make me blush. Glad to be on your team too.

        Show
        Paul Phillips added a comment - Stop, you'll make me blush. Glad to be on your team too.
        Hide
        Paul Phillips added a comment -

        19bb173264

        Show
        Paul Phillips added a comment - 19bb173264

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Iulian Dragos
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development