diff options
author | Martin Odersky <odersky@gmail.com> | 2008-08-23 14:27:21 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2008-08-23 14:27:21 +0000 |
commit | 9a984e4e5a24dcaf11942ee96067fafff96ab762 (patch) | |
tree | 9c39465c33084346ee7099a0a34f810d708dcc0e | |
parent | 138499401d806994ec6f86ddfc3713e291be5f2c (diff) | |
download | scala-9a984e4e5a24dcaf11942ee96067fafff96ab762.tar.gz scala-9a984e4e5a24dcaf11942ee96067fafff96ab762.tar.bz2 scala-9a984e4e5a24dcaf11942ee96067fafff96ab762.zip |
Fixed #1270
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/transform/Erasure.scala | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 688dda2172..cb2fa196da 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -675,7 +675,7 @@ abstract class ClassfileParser { val attrLen = in.nextInt attrName match { case nme.SignatureATTR => - if (global.settings.target.value == "jvm-1.5") { + if (!isScala && global.settings.target.value == "jvm-1.5") { val sig = pool.getExternalName(in.nextChar) val newType = sigToType(sym, sig) sym.setInfo(newType) diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala index 6ec4b95a5a..23203bd848 100644 --- a/src/compiler/scala/tools/nsc/transform/Erasure.scala +++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala @@ -157,15 +157,15 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { def javaSig(sym: Symbol): Option[String] = atPhase(currentRun.erasurePhase) { - def jsig(tp: Type): String = jsig2(List(), tp) + def jsig(tp: Type): String = jsig2(false, List(), tp) - def jsig2(tparams: List[Symbol], tp0: Type): String = { + def jsig2(toplevel: Boolean, tparams: List[Symbol], tp0: Type): String = { val tp = tp0.normalize tp match { case st: SubType => - jsig2(tparams, st.supertype) + jsig2(toplevel, tparams, st.supertype) case ExistentialType(tparams, tpe) => - jsig2(tparams, tpe) + jsig2(toplevel, tparams, tpe) case TypeRef(pre, sym, args) => def argSig(tp: Type) = if (tparams contains tp.typeSymbol) { @@ -214,7 +214,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { } assert(!tparams.isEmpty) def paramSig(tsym: Symbol) = tsym.name+boundSig(hiBounds(tsym.info.bounds)) - "<"+(tparams map paramSig).mkString+">"+jsig(restpe) + (if (toplevel) "<"+(tparams map paramSig).mkString+">" else "")+jsig(restpe) case MethodType(formals, restpe) => "("+(formals map jsig).mkString+")"+ (if (restpe.typeSymbol == UnitClass || sym.isConstructor) VOID_TAG.toString else jsig(restpe)) @@ -228,7 +228,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer { jsig(erasure(tp)) } } - if (needsJavaSig(sym.info)) Some(jsig(sym.info)) + if (needsJavaSig(sym.info)) Some(jsig2(true, List(), sym.info)) else None } |