From 983ce8da3ce321bed7f8100c00b4aa709528208e Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Mon, 17 Apr 2017 17:22:48 +0200 Subject: Pruning branch of constant type condition. As done in inliner. --- tests/run/if-with-constant-cond.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/run/if-with-constant-cond.scala (limited to 'tests/run/if-with-constant-cond.scala') 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 -- cgit v1.2.3