From 66acf364ae3003dd1abb4eeb8759afc6e12aa1a1 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 7 Jan 2013 07:42:38 +0300 Subject: SI-5903 extractor macros do work Apparently it is already possible to use macros to customize pattern matching as described in the comments to the aforementioned JIRA issue. What's even better - with the incoming addition of c.introduceTopLevel it becomes possible to generate arbitrarily complex unappliers, even with heterogeneous types of arguments varying from expansion to expansion --- test/files/run/macro-expand-unapply-b/Test_2.scala | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 test/files/run/macro-expand-unapply-b/Test_2.scala (limited to 'test/files/run/macro-expand-unapply-b/Test_2.scala') diff --git a/test/files/run/macro-expand-unapply-b/Test_2.scala b/test/files/run/macro-expand-unapply-b/Test_2.scala new file mode 100644 index 0000000000..5352160dfe --- /dev/null +++ b/test/files/run/macro-expand-unapply-b/Test_2.scala @@ -0,0 +1,8 @@ +object Test extends App { + import Macros._ + def whatever() = null + val q"$x1, $y1" = whatever() + println(x1, y1) + val q"$x2" = whatever() + println(x2) +} -- cgit v1.2.3