From 4736897ad2a6425c64cadfe80d5e6d7751ee0fec Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Sat, 23 Jun 2012 19:04:50 +0200 Subject: SI-5966 Fix eta expansion for repeated parameters with zero arguments. Reworks part of e33901 / SI-5610, which was inserting an tree as an argument in this case, which turns into a null in icode. --- test/files/run/t5966.check | 3 +++ test/files/run/t5966.scala | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/run/t5966.check create mode 100644 test/files/run/t5966.scala (limited to 'test/files/run') diff --git a/test/files/run/t5966.check b/test/files/run/t5966.check new file mode 100644 index 0000000000..bfe8358a77 --- /dev/null +++ b/test/files/run/t5966.check @@ -0,0 +1,3 @@ +(o()_)("") = List() +(o("a1")_)("") = WrappedArray(a1) +(o("a1", "a2")_)("") = WrappedArray(a1, a2) diff --git a/test/files/run/t5966.scala b/test/files/run/t5966.scala new file mode 100644 index 0000000000..bbe1a6e874 --- /dev/null +++ b/test/files/run/t5966.scala @@ -0,0 +1,9 @@ +object o { def apply(i: AnyRef*)(j: String) = i } + +object Test { + def main(args: Array[String]) { + println("(o()_)(\"\") = " + (o()_)("")) + println("(o(\"a1\")_)(\"\") = " + (o("a1")_)("")) + println("(o(\"a1\", \"a2\")_)(\"\") = " + (o("a1", "a2")_)("")) + } +} -- cgit v1.2.3