diff --git a/tests/run/i3539.scala b/tests/run/i3539.scala new file mode 100644 index 000000000000..ddef1650ceea --- /dev/null +++ b/tests/run/i3539.scala @@ -0,0 +1,16 @@ +object Test { + def main(args: Array[String]): Unit = { + val i2s = (x: Int) => "" + assert(i2s.asInstanceOf.asInstanceOf[AnyRef => String].apply(null) == "") + val i2i = (x: Int) => x + 1 + assert(i2i.asInstanceOf[AnyRef => Int].apply(null) == 1) + } +} + +class Test { + + asInstanceOf[Nothing].asInstanceOf[AnyRef => String] + + asInstanceOf[Nothing].asInstanceOf[AnyRef => String].apply(null) + +}