summaryrefslogtreecommitdiff
path: root/test/files/run/function-null-unbox.scala
blob: 6c0369fffd036ec9d5eca2060e9f3941d7c1ef9c (plain) (blame)
1
2
3
4
5
6
7
8
object Test {
  def main(args: Array[String]): Unit = {
     val i2s = (x: Int) => ""
     assert(i2s.asInstanceOf[AnyRef => String].apply(null) == "")
     val i2i = (x: Int) => x + 1
     assert(i2i.asInstanceOf[AnyRef => Int].apply(null) == 1)
   }
}