Skip to content

Commit 7626e05

Browse files
committed
Added test
1 parent 053d509 commit 7626e05

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tests/run/interpolation-opt.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ a1two3.0b
55
a1two3.0b
66

77

8+
Hello World
9+
Side effect!
810
Hello World

tests/run/interpolation-opt.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ object Test extends App {
2020
val foo = "Hello"
2121
val bar = "World"
2222
println(StringContext(foo, bar).s(" "))
23+
24+
def myStringContext= { println("Side effect!"); StringContext }
25+
println(myStringContext(foo, bar).s(" ")) // this shouldn't be optimised away
2326
}

0 commit comments

Comments
 (0)