aboutsummaryrefslogtreecommitdiff
path: root/tests/run/i2077.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/i2077.scala')
-rw-r--r--tests/run/i2077.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/run/i2077.scala b/tests/run/i2077.scala
new file mode 100644
index 000000000..42b629b90
--- /dev/null
+++ b/tests/run/i2077.scala
@@ -0,0 +1,10 @@
+object Test {
+ inline val x = true
+ val y = if (x) 1 else 2 // reduced to val y = 1
+
+ def main(args: Array[String]): Unit =
+ if ({ println("hi"); true }) // cannot be reduced
+ 1
+ else
+ 2
+}