Skip to content

Commit 2b74394

Browse files
committed
Add test for #3340 with a side effect
1 parent 2793b75 commit 2b74394

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

tests/run/i3340.check

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Test$.f1(i3340.scala:12)
2-
Test$.f2(i3340.scala:16)
3-
Test$.f3(i3340.scala:20)
4-
Test$.f4(i3340.scala:27)
5-
Test$.f5(i3340.scala:34)
1+
Test$.f1(i3340.scala:13)
2+
Test$.f2(i3340.scala:17)
3+
Test$.f3(i3340.scala:21)
4+
Test$.f4(i3340.scala:28)
5+
Test$.f5(i3340.scala:35)
6+
foo
7+
Test$.f6(i3340.scala:42)

tests/run/i3340.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ object Test {
55
printlnStackLine(f3)
66
printlnStackLine(f4)
77
printlnStackLine(f5)
8+
printlnStackLine(f6)
89
}
910

1011
def f1: Unit = {
@@ -35,6 +36,13 @@ object Test {
3536
()
3637
}
3738

39+
def f6: Unit = {
40+
val n: Any = null
41+
val a: Nothing =
42+
{ println("foo"); n }.asInstanceOf[Nothing] // throws here
43+
()
44+
}
45+
3846
def printlnStackLine(t: => Any): Unit = {
3947
try t
4048
catch {

0 commit comments

Comments
 (0)