diff options
author | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2012-07-31 17:33:45 +0200 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@gmail.com> | 2012-07-31 17:53:32 +0200 |
commit | f0f4fedd503b2d332af4ff24d1934f150f8c79fc (patch) | |
tree | cbe072ffac5748b15ccffe652a49f7457de7d787 /src | |
parent | b35894c2c341f69f61a7a0eb6131c6b3d828b1a3 (diff) | |
download | scala-f0f4fedd503b2d332af4ff24d1934f150f8c79fc.tar.gz scala-f0f4fedd503b2d332af4ff24d1934f150f8c79fc.tar.bz2 scala-f0f4fedd503b2d332af4ff24d1934f150f8c79fc.zip |
I actually managed to hit the limit of Scala signature annotation not fitting into a single string (high five everyone) and entered the undisovered region of arrEncode in GenASM.
arrEncode returns Array[String] so asm.AnnotationWriter is not going to like it.
Already discussed with @magarciaEPFL but please review again.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala index e590a0b691..f681de93b6 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala @@ -993,8 +993,13 @@ abstract class GenASM extends SubComponent with BytecodeWriters { case sb@ScalaSigBytes(bytes) => // see http://www.scala-lang.org/sid/10 (Storage of pickled Scala signatures in class files) // also JVMS Sec. 4.7.16.1 The element_value structure and JVMS Sec. 4.4.7 The CONSTANT_Utf8_info Structure. - val assocValue = (if(sb.fitsInOneString) strEncode(sb) else arrEncode(sb)) - av.visit(name, assocValue) + if (sb.fitsInOneString) + av.visit(name, strEncode(sb)) + else { + val arrAnnotV: asm.AnnotationVisitor = av.visitArray(name) + for(arg <- arrEncode(sb)) { arrAnnotV.visit(name, arg) } + arrAnnotV.visitEnd() + } // for the lazy val in ScalaSigBytes to be GC'ed, the invoker of emitAnnotations() should hold the ScalaSigBytes in a method-local var that doesn't escape. case ArrayAnnotArg(args) => |