aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/run/reflection-valueclasses-standard.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pending/run/reflection-valueclasses-standard.scala')
-rw-r--r--tests/pending/run/reflection-valueclasses-standard.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/pending/run/reflection-valueclasses-standard.scala b/tests/pending/run/reflection-valueclasses-standard.scala
new file mode 100644
index 000000000..b6b5a2ede
--- /dev/null
+++ b/tests/pending/run/reflection-valueclasses-standard.scala
@@ -0,0 +1,21 @@
+import scala.reflect.runtime.universe._
+import scala.reflect.runtime.{currentMirror => cm}
+import scala.reflect.{ClassTag, classTag}
+
+object Test extends App {
+ def test[T: ClassTag: TypeTag](x: T) = {
+ println(s"========${classTag[T].runtimeClass}========")
+ println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("getClass")).asMethod)())
+ println(cm.reflect(x).reflectMethod(typeOf[T].member(TermName("toString")).asMethod)())
+ }
+
+ test(2.toByte)
+ test(2.toShort)
+ test(2.toInt)
+ test(2.toLong)
+ test(2.toFloat)
+ test(2.toDouble)
+ test('2')
+ test(true)
+ test(())
+} \ No newline at end of file