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

crash in getPrimitive for abstract type bounded by Array[_]

    Details

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

      Description

      object Main {
        def main(args: Array[String]) {
          val seq: MySeq[Undefined] = new MySeq[Floats](new Array[Float](10))
          println(10 == seq.array.length)
        }
      }
      
      sealed trait Undefined { type ArrayType <: Array[_] }
      sealed trait Floats extends Undefined { type ArrayType = Array[Float] }
      class MySeq[+T <: Undefined](val array: T#ArrayType)
      
      Exception in thread "main" java.util.NoSuchElementException: None.get
      	at scala.None$$.get(Option.scala:262)
      	at scala.None$$.get(Option.scala:260)
      	at scala.tools.nsc.backend.ScalaPrimitives$$$$anonfun$$elementType$$1$$1.apply(ScalaPrimitives.scala:592)
      	at scala.tools.nsc.backend.ScalaPrimitives$$$$anonfun$$elementType$$1$$1.apply(ScalaPrimitives.scala:583)
      	at scala.tools.nsc.symtab.SymbolTable.atPhase(SymbolTable.scala:103)
      	at scala.tools.nsc.backend.ScalaPrimitives.elementType$$1(ScalaPrimitives.scala:583)
      	at scala.tools.nsc.backend.ScalaPrimitives.getPrimitive(ScalaPrimitives.scala:629)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genPrimitiveOp(GenICode.scala:424)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:725)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genComparisonOp$$1(GenICode.scala:1281)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genCond(GenICode.scala:1332)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genPrimitiveOp(GenICode.scala:438)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:725)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:677)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.genLoadArguments(GenICode.scala:1031)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:743)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.scala$$tools$$nsc$$backend$$icode$$GenICode$$ICodePhase$$$$genLoad(GenICode.scala:870)
      	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$$mcV$$sp(Global.scala:280)
      	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:280)
      	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$applyPhase$$1.apply(Global.scala:280)
      	at scala.tools.nsc.reporters.Reporter.withSource(Reporter.scala:48)
      	at scala.tools.nsc.Global$$GlobalPhase.applyPhase(Global.scala:280)
      	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:254)
      	at scala.tools.nsc.Global$$GlobalPhase$$$$anonfun$$run$$1.apply(Global.scala:254)
      	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:254)
      	at scala.tools.nsc.backend.icode.GenICode$$ICodePhase.run(GenICode.scala:66)
      	at scala.tools.nsc.Global$$Run.compileSources(Global.scala:737)
      	at scala.tools.nsc.Global$$Run.compile(Global.scala:818)
      	at scala.tools.nsc.Main$$.process(Main.scala:108)
      	at scala.tools.nsc.Main$$.main(Main.scala:122)
      	at scala.tools.nsc.Main.main(Main.scala)
      

        Activity

        Hide
        Paul Phillips added a comment -

        Fixed sometime since 2.9.2, test in e982596149.

        Show
        Paul Phillips added a comment - Fixed sometime since 2.9.2, test in e982596149.

          People

          • Assignee:
            Iulian Dragos
            Reporter:
            Iulian Dragos
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development