From 28c5f730820dd76d85c2f6f81bf60aae03aabe41 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Wed, 5 Jun 2013 09:28:22 +0200 Subject: SI-7556 Fix runtime reflection involving ScalaLongSignature Scala type information is stored in classfiles in encoded in a String in the ScalaSignature annotation. When it is too big for a single String, it is split into an array of Strings in a different annotation, ScalaLongSignature. The enclosed test, with a class containing 3000 methods, uses the latter. It exposes a bug in the way runtime reflection decodes that data. It must concatentate and *then* decode, rather that the other way around. --- test/files/run/t7556/Test_2.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/files/run/t7556/Test_2.scala (limited to 'test/files/run/t7556/Test_2.scala') diff --git a/test/files/run/t7556/Test_2.scala b/test/files/run/t7556/Test_2.scala new file mode 100644 index 0000000000..31848738ef --- /dev/null +++ b/test/files/run/t7556/Test_2.scala @@ -0,0 +1,11 @@ +import scala.reflect.runtime.universe._ + +object Test { + def main(args: Array[String]) { + val mc = new MegaClass + val anns = mc.getClass.getAnnotations.map(_.annotationType.getName).toList.sorted + println(s"class annotations: $anns") + val N = typeTag[MegaClass].tpe.declarations.size // was: error reading Scala signature of MegaClass: 65935 + println(s"$N decls via runtime reflection") + } +} -- cgit v1.2.3