Aladdin - Scala Bugtracking
[#369] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-10-01 14:35:44.0
subject pattern with unknow value and wildcard crashes the analyzer
code
class Foo {
  case class Bar(i: Int) extends Foo;
  match { case x.Bar(_) => 0 }
}
what happened
tmp/test.scala:3: not found: value x
  match { case x.Bar(_) => 0 }
               ^
Exception in thread "main" java.lang.Error: assertion failed: _
	at scala.Predef$.assert(Predef.scala:76)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2101)
	at scala.tools.scalac.typechecker.Analyzer$class.transformArgs(Analyzer.scala:2081)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.scala$tools$scalac$typechecker$Analyzer$$anon$21$handleAppl\
y$0(Analyzer.scala:2792)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2877)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2178)
	at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
	at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:29)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2177)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2099)
	at scala.tools.scalac.typechecker.Analyzer$class.transformCase(Analyzer.scala:1844)
	at scala.tools.scalac.typechecker.Analyzer$class.transformVisitor(Analyzer.scala:1827)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.scala$tools$scalac$typechecker$Analyzer$$anon$21$handleAppl\
y$0(Analyzer.scala:2774)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2877)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2178)
	at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
	at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:29)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2177)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2099)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2114)
	at scala.tools.scalac.typechecker.Analyzer$class.transformStatSeq(Analyzer.scala:1865)
	at scala.tools.scalac.typechecker.Analyzer$class.transformTemplate(Analyzer.scala:1948)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2246)
	at scala.tools.scalac.typechecker.Analyzer$$anon$21.apply(Analyzer.scala:2178)
	at scala.runtime.ResultOrException.tryBlock(ResultOrException.java:34)
	at scala.runtime.ScalaRunTime$.Try(ScalaRunTime.scala:29)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2177)
	at scala.tools.scalac.typechecker.Analyzer$class.transform(Analyzer.scala:2118)
	at scala.tools.scalac.typechecker.Analyzer$class.transformStatSeq(Analyzer.scala:1868)
	at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:131)
	at scalac.ast.Transformer.apply(Transformer.java:64)
	at scala.tools.scalac.typechecker.Analyzer$class.apply(Analyzer.scala:67)
	at scala.tools.scalac.typechecker.AnalyzerPhase$class.apply(AnalyzerPhase.scala:69)
	at scalac.Global.compile(Global.java:390)
	at scalac.Global.compile(Global.java:360)
	at scala.tools.scalac.Main$.main1(Main.scala:45)
	at scala.tools.scalac.Main$.main(Main.scala:28)
	at scala.tools.scalac.Main.main(Main.scala:28)
what expected Just the error message, no crash.
[back to overview]
Changes of this bug report
Martin  edited on  2004-11-18 15:13:51.0
Martin  edited on  2004-11-18 15:14:09.0