aboutsummaryrefslogtreecommitdiff
path: root/tests/run/if-with-constant-cond.scala
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2017-04-17 17:22:48 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2017-04-17 17:39:02 +0200
commit983ce8da3ce321bed7f8100c00b4aa709528208e (patch)
tree02120350c1f7cdb37efffa53372ba4fcaed30580 /tests/run/if-with-constant-cond.scala
parentea9325965a82610083e75e0d111fe3d70c46b3d2 (diff)
downloaddotty-983ce8da3ce321bed7f8100c00b4aa709528208e.tar.gz
dotty-983ce8da3ce321bed7f8100c00b4aa709528208e.tar.bz2
dotty-983ce8da3ce321bed7f8100c00b4aa709528208e.zip
Pruning branch of constant type condition.
As done in inliner.
Diffstat (limited to 'tests/run/if-with-constant-cond.scala')
-rw-r--r--tests/run/if-with-constant-cond.scala9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/run/if-with-constant-cond.scala b/tests/run/if-with-constant-cond.scala
new file mode 100644
index 000000000..db5959c84
--- /dev/null
+++ b/tests/run/if-with-constant-cond.scala
@@ -0,0 +1,9 @@
+
+object Test {
+
+ def main(args: Array[String]): Unit = {
+ if ({ println("cond1"); true }: true) println("then1") else println("else1")
+ if ({ println("cond2"); false }: false) println("then2") else println("else2")
+ }
+
+} \ No newline at end of file