summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-24 22:46:34 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-01-25 09:45:44 +0300
commit6c1129bdc274eeb822a1924cb22d852ea9cd62de (patch)
treefb0f2387901a24c506449f668c27be9811eb7bcb /test/files/run
parent32a02d6f7c697870c071b86e6552740bcced7697 (diff)
downloadscala-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')
-rw-r--r--test/files/run/reflection-magicsymbols-invoke.check2
-rw-r--r--test/files/run/t6411a.check (renamed from test/files/run/t6411.check)0
-rw-r--r--test/files/run/t6411a.scala (renamed from test/files/run/t6411.scala)0
-rw-r--r--test/files/run/t6411b.check1
-rw-r--r--test/files/run/t6411b.scala12
5 files changed, 14 insertions, 1 deletions
diff --git a/test/files/run/reflection-magicsymbols-invoke.check b/test/files/run/reflection-magicsymbols-invoke.check
index 352aefaf25..7f9767f095 100644
--- a/test/files/run/reflection-magicsymbols-invoke.check
+++ b/test/files/run/reflection-magicsymbols-invoke.check
@@ -28,7 +28,7 @@ it's important to print the list of AnyVal's members
if some of them change (possibly, adding and/or removing magic symbols), we must update this test
constructor AnyVal: ()AnyVal
method getClass: ()Class[_ <: AnyVal]
-testing AnyVal.<init>: class java.lang.InstantiationException: null
+testing AnyVal.<init>: class scala.ScalaReflectionException: unsupported symbol constructor AnyVal when invoking constructor mirror for scala.AnyVal.<init>(): AnyVal (bound to null)
testing AnyVal.getClass: class scala.ScalaReflectionException: expected a member of class Integer, you provided method scala.AnyVal.getClass
============
AnyRef
diff --git a/test/files/run/t6411.check b/test/files/run/t6411a.check
index 9226146195..9226146195 100644
--- a/test/files/run/t6411.check
+++ b/test/files/run/t6411a.check
diff --git a/test/files/run/t6411.scala b/test/files/run/t6411a.scala
index 3bfeac2890..3bfeac2890 100644
--- a/test/files/run/t6411.scala
+++ b/test/files/run/t6411a.scala
diff --git a/test/files/run/t6411b.check b/test/files/run/t6411b.check
new file mode 100644
index 0000000000..e20bed6d8d
--- /dev/null
+++ b/test/files/run/t6411b.check
@@ -0,0 +1 @@
+Bar(Foo(3))
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