diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-01-24 22:46:34 +0300 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-01-25 09:45:44 +0300 |
commit | 6c1129bdc274eeb822a1924cb22d852ea9cd62de (patch) | |
tree | fb0f2387901a24c506449f668c27be9811eb7bcb /test/files/run/t6411b.scala | |
parent | 32a02d6f7c697870c071b86e6552740bcced7697 (diff) | |
download | scala-6c1129bdc274eeb822a1924cb22d852ea9cd62de.tar.gz scala-6c1129bdc274eeb822a1924cb22d852ea9cd62de.tar.bz2 scala-6c1129bdc274eeb822a1924cb22d852ea9cd62de.zip |
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.
Diffstat (limited to 'test/files/run/t6411b.scala')
-rw-r--r-- | test/files/run/t6411b.scala | 12 |
1 files changed, 12 insertions, 0 deletions
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 |