From bc4468cdd266fc12fe164c1b6ec4da94b71a4129 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 9 Oct 2011 19:24:48 +0000 Subject: Flipped varargs eta-expansion behavior. (T*)U now eta-expands to Seq[T] => U, not T* => U. There is a transition command line switch to get the old behavior for any who may have relied upon it: -Yeta-expand-keeps-star Closes SI-4176, no review. --- test/files/neg/eta-expand-star.check | 4 ++++ test/files/neg/eta-expand-star.scala | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/neg/eta-expand-star.check create mode 100644 test/files/neg/eta-expand-star.scala (limited to 'test/files/neg') diff --git a/test/files/neg/eta-expand-star.check b/test/files/neg/eta-expand-star.check new file mode 100644 index 0000000000..6765d504fc --- /dev/null +++ b/test/files/neg/eta-expand-star.check @@ -0,0 +1,4 @@ +eta-expand-star.scala:6: error: too many arguments for method apply: (v1: Seq[T])Unit in trait Function1 + g(1, 2) + ^ +one error found diff --git a/test/files/neg/eta-expand-star.scala b/test/files/neg/eta-expand-star.scala new file mode 100644 index 0000000000..5749692522 --- /dev/null +++ b/test/files/neg/eta-expand-star.scala @@ -0,0 +1,8 @@ +object Test { + def f[T](xs: T*): Unit = () + def g[T] = f[T] _ + + def main(args: Array[String]): Unit = { + g(1, 2) + } +} -- cgit v1.2.3