diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/reflection-magicsymbols-invoke.check | 2 | ||||
-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.check | 1 | ||||
-rw-r--r-- | test/files/run/t6411b.scala | 12 |
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 |