aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-03-13 17:19:07 +0100
committerMartin Odersky <odersky@gmail.com>2015-03-13 17:19:07 +0100
commit3e849296a8563a561f53c92b48bd720897694b63 (patch)
tree30f98d03708e48db9f1bc4c42bcdfc48a14bf69c /tests
parent0ee93122b9e367c08ed1d81c9cfc5919fc3a32af (diff)
downloaddotty-3e849296a8563a561f53c92b48bd720897694b63.tar.gz
dotty-3e849296a8563a561f53c92b48bd720897694b63.tar.bz2
dotty-3e849296a8563a561f53c92b48bd720897694b63.zip
Fix #400
In a call-by-name arg, replace () => f.apply() with f only if f is pure.
Diffstat (limited to 'tests')
-rw-r--r--tests/pos/i0400.scala13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/pos/i0400.scala b/tests/pos/i0400.scala
new file mode 100644
index 000000000..701dc88fd
--- /dev/null
+++ b/tests/pos/i0400.scala
@@ -0,0 +1,13 @@
+object Test {
+ def foo: Unit = {
+ def a = () => ""
+ bar({???; a}.apply())
+ }
+ def bar(a: => Any): Unit = {
+ baz(a)
+ }
+ def baz(a: => Any): Unit = ()
+ def main(args: Array[String]): Unit = {
+ foo
+ }
+}