Skip to content

Commit 20945a2

Browse files
Merge pull request #4958 from dotty-staging/fix-#3539
Fix #3539: Add regression tests
2 parents e8f137c + 3bd6afe commit 20945a2

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/run/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(i2s.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)