summaryrefslogtreecommitdiff
path: root/test/files/run/delambdafy-nested-by-name.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-11-07 10:56:47 -0800
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-11-07 10:56:47 -0800
commite72c11e18062b4e281cc38fb7727b3bd144c8594 (patch)
treec73549ee81ec9aacab999fc68673133940d5ae26 /test/files/run/delambdafy-nested-by-name.scala
parentbb02fb350f7ec4aefcc830fec36a964ae45cfdd4 (diff)
parentef995ac6b4030e3cd10e487d414c941e5794666f (diff)
downloadscala-e72c11e18062b4e281cc38fb7727b3bd144c8594.tar.gz
scala-e72c11e18062b4e281cc38fb7727b3bd144c8594.tar.bz2
scala-e72c11e18062b4e281cc38fb7727b3bd144c8594.zip
Merge pull request #3081 from JamesIry/wip_delayed_delambdafy_cleanup
Delay delambdafication and put the lambda's body into the containing class
Diffstat (limited to 'test/files/run/delambdafy-nested-by-name.scala')
-rw-r--r--test/files/run/delambdafy-nested-by-name.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/files/run/delambdafy-nested-by-name.scala b/test/files/run/delambdafy-nested-by-name.scala
new file mode 100644
index 0000000000..4498b3308d
--- /dev/null
+++ b/test/files/run/delambdafy-nested-by-name.scala
@@ -0,0 +1,11 @@
+// during development of delayed delambdafication I created a bug where calling a by-name method with a by-name argument that
+// itself contained a by-name argument would cause a class cast exception. That bug wasn't found in the existing test suite
+// so this test covers that case
+object Test {
+ def meth1(arg1: => String) = arg1
+ def meth2(arg2: => String) = meth1({println("hello"); arg2})
+
+ def main(args: Array[String]) {
+ println(meth2("world"))
+ }
+} \ No newline at end of file