summaryrefslogtreecommitdiff
path: root/test/files/run/delambdafy-nested-by-name.scala
diff options
context:
space:
mode:
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