From 6c1129bdc274eeb822a1924cb22d852ea9cd62de Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Fri, 24 Jan 2014 22:46:34 +0300 Subject: unifies method and constructor handling in JavaMirrors This automatically brings performance fixes and correct handling of values class / by-name params into the constructor land. --- test/files/run/t6411b.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/files/run/t6411b.scala (limited to 'test/files/run/t6411b.scala') diff --git a/test/files/run/t6411b.scala b/test/files/run/t6411b.scala new file mode 100644 index 0000000000..af30108826 --- /dev/null +++ b/test/files/run/t6411b.scala @@ -0,0 +1,12 @@ +import scala.reflect.runtime.universe._ + +case class Foo(n: Int) extends AnyVal +case class Bar(foo: Foo) + +object Test extends App { + val mirror = runtimeMirror(getClass.getClassLoader) + val cm = mirror.reflectClass(typeOf[Bar].typeSymbol.asClass) + val ctor = typeOf[Bar].declaration(nme.CONSTRUCTOR).asMethod + val ctorm = cm.reflectConstructor(ctor) + println(ctorm(Foo(3))) +} \ No newline at end of file -- cgit v1.2.3