From 3c4f4865f6420f98a7ed502257bc65387951e26c Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 6 Aug 2012 17:40:28 +0200 Subject: SI-6181 method mirrors now support by-name args Arguments provided in by-name positions are now automatically wrapped in Function0 instances by method mirrors. --- test/files/run/t6181.check | 1 + test/files/run/t6181.scala | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 test/files/run/t6181.check create mode 100644 test/files/run/t6181.scala (limited to 'test') diff --git a/test/files/run/t6181.check b/test/files/run/t6181.check new file mode 100644 index 0000000000..d8263ee986 --- /dev/null +++ b/test/files/run/t6181.check @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/test/files/run/t6181.scala b/test/files/run/t6181.scala new file mode 100644 index 0000000000..fb23eaff63 --- /dev/null +++ b/test/files/run/t6181.scala @@ -0,0 +1,8 @@ +import scala.reflect.runtime.universe._ +import scala.reflect.runtime.{currentMirror => cm} + +object Test extends App { + class C { def test(x: => Int) = println(x) } + val mm = cm.reflect(new C).reflectMethod(typeOf[C].member(newTermName("test")).asMethod) + mm(2) +} \ No newline at end of file -- cgit v1.2.3