diff options
author | Martin Odersky <odersky@gmail.com> | 2017-02-02 10:27:59 +1100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-02-02 10:27:59 +1100 |
commit | 92ab901869e110a2fe436bca793578d640b9def3 (patch) | |
tree | 0f23b8e0aa864a3cfba120ec880f77342d36e6fb /tests | |
parent | cca5dd9bd0c8f0d2e5679c81f2c40247a45d7a02 (diff) | |
download | dotty-92ab901869e110a2fe436bca793578d640b9def3.tar.gz dotty-92ab901869e110a2fe436bca793578d640b9def3.tar.bz2 dotty-92ab901869e110a2fe436bca793578d640b9def3.zip |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/i1569.check | 2 | ||||
-rw-r--r-- | tests/run/i1569.scala | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/run/i1569.check b/tests/run/i1569.check new file mode 100644 index 000000000..0d55bed3a --- /dev/null +++ b/tests/run/i1569.check @@ -0,0 +1,2 @@ +foo +foo 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 }) +} |