diff options
-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 } |