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

"Unexpected tree in genLoad" compiler crash when invoking super.+(String)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.9.2
    • Fix Version/s: Scala 2.10.0-M2
    • Component/s: Misc Compiler
    • Environment:

      Reproduced in 5th oct nightly (5th is broken) and on build from github master.

      Description

      Try to compile this:

      class A {
        super.+("")
      }
      

      and you'll get this:

      Exception in thread "main" java.lang.Error: Unexpected tree in genLoad: A.super at: source-../scala/test/files/neg/supper-to-breakfast.scala,line-2,offset=12
      	at scala.tools.nsc.symtab.SymbolTable.abort(SymbolTable.scala:33)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:941)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadArguments(GenICode.scala:1030)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:742)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genLoadQualifier(GenICode.scala:981)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:739)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genStat(GenICode.scala:183)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:155)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$genStat$1.apply(GenICode.scala:155)
      	at scala.collection.LinearSeqOptimized$class.foldLeft(LinearSeqOptimized.scala:123)
      	at scala.collection.immutable.List.foldLeft(List.scala:45)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.genStat(GenICode.scala:155)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.scala$tools$nsc$backend$icode$GenICode$ICodePhase$$genLoad(GenICode.scala:868)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:126)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:81)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:81)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
      	at scala.collection.immutable.List.foreach(List.scala:45)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:148)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:100)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:81)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase$$anonfun$gen$1.apply(GenICode.scala:81)
      	at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61)
      	at scala.collection.immutable.List.foreach(List.scala:45)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:81)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:91)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.gen(GenICode.scala:77)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.apply(GenICode.scala:73)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:288)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$applyPhase$1.apply(Global.scala:288)
      	at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:47)
      	at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:288)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:260)
      	at scala.tools.nsc.Global$GlobalPhase$$anonfun$run$1.apply(Global.scala:260)
      	at scala.collection.Iterator$class.foreach(Iterator.scala:631)
      	at scala.collection.mutable.ListBuffer$$anon$1.foreach(ListBuffer.scala:304)
      	at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:260)
      	at scala.tools.nsc.backend.icode.GenICode$ICodePhase.run(GenICode.scala:66)
      	at scala.tools.nsc.Global$Run.compileSources(Global.scala:761)
      	at scala.tools.nsc.Global$Run.compile(Global.scala:842)
      	at scala.tools.nsc.Main$.process(Main.scala:106)
      	at scala.tools.nsc.Main$.main(Main.scala:120)
      	at scala.tools.nsc.Main.main(Main.scala)
      

      The problem is specific to the `+(String)` method, and involves implicit view any2stringadd applied on A.super, as if super was not as the reserved word it is.

        Activity

        Hide
        Paul Phillips added a comment -

        Subsuming into SI-4987.

        Show
        Paul Phillips added a comment - Subsuming into SI-4987 .
        Hide
        Paul Phillips added a comment -

        Reopening because the subsumption ticket seems to have been fixed as a consequence of error trees, but this wasn't.

        Show
        Paul Phillips added a comment - Reopening because the subsumption ticket seems to have been fixed as a consequence of error trees, but this wasn't.
        Hide
        Aleksandar Prokopec added a comment - - edited

        Seems to work now. That is, fails with an error message.

        Show
        Aleksandar Prokopec added a comment - - edited Seems to work now. That is, fails with an error message.
        Hide
        Paul Phillips added a comment -

        Looks like martin fixed in bed3304bf86 .

        Show
        Paul Phillips added a comment - Looks like martin fixed in bed3304bf86 .

          People

          • Assignee:
            Paul Phillips
            Reporter:
            Jordi Salvat i Alabart
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development