Skip to content

Commit d105229

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

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

tests/pos/i3539.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
}

tests/pos/i3539b.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Test {
2+
asInstanceOf.asInstanceOf[AnyRef => String]
3+
}

tests/pos/i3539c.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Test {
2+
asInstanceOf.asInstanceOf[AnyRef => String].apply(null)
3+
}

0 commit comments

Comments
 (0)