Aladdin - Scala Bugtracking
[#1107] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Martin fixed 2007-05-15 11:05:38.0
subject NullPointerException in erasure
code
object F {
  def tryf[T](ignore: List[Class])(f: => T): Any = {
    try {
      f
    } catch {
      case e if ignore == null || ignore.isEmpty => {false}
    }
  }
}
what happened
scala.tools.nsc.symtab.Types$TypeError: type mismatch;
 found   : Boolean
 required: Boolean with NotNull
        at scala.tools.nsc.typechecker.Contexts$Context.error(Contexts.scala:268)
[...]
Exception in thread "main" java.lang.NullPointerException
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$2.transform(Erasure.scala:743)
        at scala.tools.nsc.ast.Trees$Transformer.transform(Trees.scala:1230)
        at scala.tools.nsc.transform.Erasure$ErasureTransformer$$anon$2.transform(Erasure.scala:849)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1308)
        at scala.tools.nsc.ast.Trees$Transformer$$anonfun$33.apply(Trees.scala:1308)
        at scala.List$.loop$0(List.scala:243)
        at scala.List$.mapConserve(List.scala:260)
[...]
what expected compiles (contributed by D. Pollack)
[back to overview]
Changes of this bug report
Martin  edited on  2007-05-15 14:14:12.0
fixed in 2.5.0 branch and trunk