From 92ab901869e110a2fe436bca793578d640b9def3 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 2 Feb 2017 10:27:59 +1100 Subject: Fix #1569: Fix logic for by-name parameters of inline methods As #1569 shows, by-name parameters should be treated in the same way as by-value parameters. If the expression is not pure, install a binding. --- tests/run/i1569.scala | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/run/i1569.scala (limited to 'tests/run/i1569.scala') diff --git a/tests/run/i1569.scala b/tests/run/i1569.scala new file mode 100644 index 000000000..2c5dd4e5a --- /dev/null +++ b/tests/run/i1569.scala @@ -0,0 +1,5 @@ +object Test { + inline def foo(inline n: => Int) = n + n + + def main(args: Array[String]): Unit = foo({ println("foo"); 42 }) +} -- cgit v1.2.3