diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-06-25 17:08:45 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2013-06-25 17:08:45 -0700 |
commit | 807dc9e15fa36cc92a9bd2802dbfbff2de5d0dec (patch) | |
tree | 14c9e0b3412df3ff8bb699d7effb0c0b57f930c0 /test/files/run | |
parent | 2a17db002758379fe0b9ee2a4e41ac9e3ca6c30d (diff) | |
parent | 9f2b2894ba2b45135943e943d13898aefc333cc2 (diff) | |
download | scala-807dc9e15fa36cc92a9bd2802dbfbff2de5d0dec.tar.gz scala-807dc9e15fa36cc92a9bd2802dbfbff2de5d0dec.tar.bz2 scala-807dc9e15fa36cc92a9bd2802dbfbff2de5d0dec.zip |
Merge pull request #2659 from retronym/ticket/7584
SI-7584 Fix typer regression with by-name parameter types
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t7584.check | 6 | ||||
-rw-r--r-- | test/files/run/t7584.flags | 1 | ||||
-rw-r--r-- | test/files/run/t7584.scala | 14 |
3 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/t7584.check b/test/files/run/t7584.check new file mode 100644 index 0000000000..9f53e5dde5 --- /dev/null +++ b/test/files/run/t7584.check @@ -0,0 +1,6 @@ +no calls +call A +a +call B twice +b +b diff --git a/test/files/run/t7584.flags b/test/files/run/t7584.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/run/t7584.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/run/t7584.scala b/test/files/run/t7584.scala new file mode 100644 index 0000000000..6d7f4f7ebb --- /dev/null +++ b/test/files/run/t7584.scala @@ -0,0 +1,14 @@ +// Test case added to show the behaviour of functions with +// by-name parameters. The evaluation behaviour was already correct. +// +// We did flush out a spurious "pure expression does nothing in statement position" +// warning, hence -Xfatal-warnings in the flags file. +object Test extends App { + def foo(f: (=> Int, => Int) => Unit) = f({println("a"); 0}, {println("b"); 1}) + println("no calls") + foo((a, b) => ()) + println("call A") + foo((a, b) => a) + println("call B twice") + foo((a, b) => {b; b}) +} |