diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-06-05 09:28:22 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-06-05 09:28:22 +0200 |
commit | 28c5f730820dd76d85c2f6f81bf60aae03aabe41 (patch) | |
tree | ba8654b4686850c643b73dab6f2ee099967ec678 /test/files/run/t7556/Test_2.scala | |
parent | 681f2070053bc6f3133425b44083fe056bfeb1fa (diff) | |
download | scala-28c5f730820dd76d85c2f6f81bf60aae03aabe41.tar.gz scala-28c5f730820dd76d85c2f6f81bf60aae03aabe41.tar.bz2 scala-28c5f730820dd76d85c2f6f81bf60aae03aabe41.zip |
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.
Diffstat (limited to 'test/files/run/t7556/Test_2.scala')
-rw-r--r-- | test/files/run/t7556/Test_2.scala | 11 |
1 files changed, 11 insertions, 0 deletions
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") + } +} |