Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: Scala 2.11.0-M2
    • Fix Version/s: Scala 2.11.0-M2
    • Component/s: Compiler Backend
    • Labels:
      None

      Description

      The compiler crashes with an assertion error while building the IDE. The exception trace is below, I attached the full info. I'll report back if I can minimize it.

      EDIT: Minimized code:

      trait T {
        def bar: Array[String]
      }
      
      class Foo extends T {
        def bar = null
      }
      
      [INFO] == Expanded type of tree ==
      [INFO] 
      [INFO] TypeRef(TypeSymbol(final abstract class Unit extends ))
      [INFO] 
      [INFO] Attempt to adapt a null to a non reference type $to.
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.adaptNullRef(GenICode.scala:1028)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadApply6$1(GenICode.scala:800)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:804)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:122)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:70)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:147)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:97)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:70)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:88)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:66)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:62)
      [INFO] 	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:413)
      [INFO] 	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:380)
      [INFO] 	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:380)
      [INFO] 	at scala.collection.Iterator$class.foreach(Iterator.scala:725)
      [INFO] 	at scala.collection.AbstractIterator.foreach(Iterator.scala:1156)
      [INFO] 	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:380)
      [INFO] 	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:55)
      [INFO] 	at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1508)
      [INFO] 	at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1483)
      [INFO] 	at scala.tools.nsc.Global$Run.compileSources(Global.scala:1479)
      [INFO] 	at scala.tools.nsc.Global$Run.compile(Global.scala:1586)
      [INFO] 	at scala.tools.nsc.Driver.doCompile(Driver.scala:33)
      [INFO] 	at scala.tools.nsc.MainClass.doCompile(Main.scala:21)
      [INFO] 	at scala.tools.nsc.Driver.process(Driver.scala:54)
      [INFO] 	at scala.tools.nsc.Driver.main(Driver.scala:67)
      [INFO] 	at scala.tools.nsc.Main.main(Main.scala)
      [INFO] 	... 6 more
      

        Activity

        Hide
        Paul Phillips added a comment -

        Ah yes, good old type $to.

        Show
        Paul Phillips added a comment - Ah yes, good old type $to.
        Hide
        James Iry added a comment -

        Iulian, thanks for the minimization. It confirms what I suspected. Also, it would be great if we had a warning for string literals with $foo where foo is an identifier in scope, but Paul P. tells me the warning is too noisy. Maybe -Xlint.

        Show
        James Iry added a comment - Iulian, thanks for the minimization. It confirms what I suspected. Also, it would be great if we had a warning for string literals with $foo where foo is an identifier in scope, but Paul P. tells me the warning is too noisy. Maybe -Xlint.
        Show
        James Iry added a comment - https://github.com/scala/scala/pull/2216
        Hide
        Iulian Dragos added a comment -

        I just realized why I wasted hours on this... the error message is very confusing. The trees that it spits out have nothing to do with what was compiled during the crash (probably the last tree that passed by the typer, 12 phases before?). Since they are so verbose, they completely dwarfed the only piece of useful information: the file name that was compiled at the time of the crash. Could the machinery that prints trees be made backend friendly? That would definitely save some time next time.

        Show
        Iulian Dragos added a comment - I just realized why I wasted hours on this... the error message is very confusing. The trees that it spits out have nothing to do with what was compiled during the crash (probably the last tree that passed by the typer, 12 phases before?). Since they are so verbose, they completely dwarfed the only piece of useful information: the file name that was compiled at the time of the crash. Could the machinery that prints trees be made backend friendly? That would definitely save some time next time.

          People

          • Assignee:
            James Iry
            Reporter:
            Iulian Dragos
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development