Skip to content

Commit 05cd85b

Browse files
committed
Fix #3539: Add regression tests
1 parent 61cba97 commit 05cd85b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/pos/i3539.scala

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
object Test {
2+
def main(args: Array[String]): Unit = {
3+
val i2s = (x: Int) => ""
4+
assert(asInstanceOf.asInstanceOf[AnyRef => String].apply(null) == "")
5+
val i2i = (x: Int) => x + 1
6+
assert(i2i.asInstanceOf[AnyRef => Int].apply(null) == 1)
7+
}
8+
}
9+
10+
class Test {
11+
12+
asInstanceOf[Nothing].asInstanceOf[AnyRef => String]
13+
14+
asInstanceOf[Nothing].asInstanceOf[AnyRef => String].apply(null)
15+
16+
}

0 commit comments

Comments
 (0)