Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
scabug opened this Issue Aug 26, 2010 · 2 comments

Comments

Projects
None yet
2 participants
@scabug
Copy link

scabug commented Aug 26, 2010

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)
@scabug

This comment has been minimized.

Copy link
Author

scabug commented Aug 26, 2010

@scabug

This comment has been minimized.

Copy link
Author

scabug commented May 8, 2012

@paulp said:
Fixed sometime since 2.9.2, test in e982596149.

@scabug scabug closed this May 8, 2012

@scabug scabug added this to the 2.10.0-M3 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.