Aladdin - Scala Bugtracking
[#329] project: compiler priority: high category: bug
submitter assigned to status date submitted
Burak Martin fixed 2004-05-07 13:12:37.0
subject crash in type inference
code
import scala.collection._;

object foo {
  
  val snafu = immutable.TreeMap.Empty;

}
what happened
Exception in thread "main" scalac.ApplicationError: illegal case: 
        at scalac.util.Debug.abort(Debug.java:58)
        at scalac.symtab.ClosureHistory.addParents(ClosureHistory.java:70)
        at scalac.symtab.ClosureHistory.computeValue(ClosureHistory.java:41)
        at scalac.framework.History.computeValueAt(History.java:206)
        at scalac.framework.History.incrementLimit(History.java:242)
        at scalac.framework.History.getValueAt(History.java:98)
        at scalac.framework.History.getValue(History.java:87)
        at scalac.symtab.TypeSymbol.closure(Symbol.java:1875)
        at scalac.symtab.Symbol.closurePos(Symbol.java:1419)
        at scalac.symtab.Symbol.baseType(Symbol.java:1434)
        at scalac.symtab.Type.baseType(Type.java:1196)
        at scalac.symtab.Type.baseType(Type.java:1183)
        at scalac.symtab.Type.isSubType0(Type.java:1904)
        at scalac.symtab.Type.isSubType(Type.java:1850)
        at scala.tools.scalac.typechecker.Infer$class.isCompatible(Infer.scala:739)
        at scala.tools.scalac.typechecker.Infer$class.isCompatible(Infer.scala:760)
        at scala.tools.scalac.typechecker.Infer$class.isApplicable(Infer.scala:1118)
        at scala.tools.scalac.typechecker.Infer$class.bestView(Infer.scala:1299)
        at scala.tools.scalac.typechecker.Analyzer$class.transformSelect(Analyzer.scala:1730)
        at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2821)
        at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2126)
        at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
        at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:19)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2125)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2047)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2062)
        at scala.tools.scalac.typechecker.Analyzer$$anon$16.apply(Analyzer.scala:1180)
        at scala.tools.scalac.typechecker.Analyzer$$anon$16.apply(Analyzer.scala:1078)
        at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
        at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:19)
        at scala.tools.scalac.typechecker.Analyzer$class.defineSym(Analyzer.scala:1078)
        at scala.tools.scalac.typechecker.Analyzer$LazyTreeType$class.complete(Analyzer.scala:649)
        at scalac.symtab.Symbol.info(Symbol.java:1145)
        at scalac.symtab.Symbol.initialize(Symbol.java:1111)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2123)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2066)
        at scala.tools.scalac.typechecker.Analyzer$class.transformStatSeq(Analyzer.scala:1825)
        at scala.tools.scalac.typechecker.Analyzer$class.transformTemplate(Analyzer.scala:1904)
        at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2176)
        at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2126)
        at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
        at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:19)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2125)
        at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2066)
        at scala.tools.scalac.typechecker.Analyzer$class.transformStatSeq(Analyzer.scala:1825)
        at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:130)
        at scalac.ast.Transformer.apply(Transformer.java:64)
        at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:64)
        at scala.tools.scalac.typechecker.AnalyzerPhase$class.apply(AnalyzerPhase.scala:61)
        at scalac.Global.compile(Global.java:380)
        at scalac.Global.compile(Global.java:351)
        at scala.tools.scalac.Main$.main1(Main.scala:35)
        at scala.tools.scalac.Main$.main(Main.scala:27)
        at scala.tools.scalac.Main.main(Main.scala:27)
what expected an error message telling me that Empty does not exist (the right thing would have been "empty", in lowercase).
[back to overview]
Changes of this bug report
Burak  edited on  2004-05-07 13:20:57.0
further simplification. original code was
val bar:Map[Int,Set[Int]] = 
      immutable.TreeMap.Empty[Int,immutable.Set[Int]];

val baz = immutable.TreeMap.Empty[Int,immutable.Set[Int]];
Burak  edited on  2004-05-07 13:22:41.0
(parts of stacktrace were missing)
Burak  edited on  2004-05-07 13:31:31.0
I corrected the "what expected" entry of this bug report, after realizing that Empty does not exist.
Martin  edited on  2004-05-13 12:55:13.0