Skip to content

Instantly share code, notes, and snippets.

@kmizu
Created May 12, 2010 12:03
Show Gist options
  • Save kmizu/398499 to your computer and use it in GitHub Desktop.
Save kmizu/398499 to your computer and use it in GitHub Desktop.
// It compiled under Scala 2.7.7.final. However, it doesn't compile under Scala 2.8.0.RC2.
import scala.collection.mutable.{Map}
object TypeInferenceFailure {
def f(x: Int) = x match {
case 0 => null.asInstanceOf[List[String]]
case _ => null.asInstanceOf[Map[Int, Int]]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment