summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2008-10-13 12:49:43 +0000
committerMartin Odersky <odersky@gmail.com>2008-10-13 12:49:43 +0000
commit40cdd1639dfbacc3be6c723be2c071f815afaabf (patch)
treef05ec982c30681fdd70b2a4376034d00ce53d206
parentbfb332daa422ddb21e87e54ada8485fdb37798d0 (diff)
downloadscala-40cdd1639dfbacc3be6c723be2c071f815afaabf.tar.gz
scala-40cdd1639dfbacc3be6c723be2c071f815afaabf.tar.bz2
scala-40cdd1639dfbacc3be6c723be2c071f815afaabf.zip
fixed #1241, #1263, #1235
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 6ec4b95a5a..48a096a78b 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) {
@@ -177,7 +177,7 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
def classSig: String =
"L"+atPhase(currentRun.icodePhase)(sym.fullNameString).replace('.', '/')
def classSigSuffix: String =
- "."+atPhase(currentRun.icodePhase)(sym.name)
+ "."+sym.name
if (sym == ArrayClass)
ARRAY_TAG.toString+(args map jsig).mkString
else if (sym.isTypeParameterOrSkolem)
@@ -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,10 @@ abstract class Erasure extends AddInterfaces with typechecker.Analyzer {
jsig(erasure(tp))
}
}
- if (needsJavaSig(sym.info)) Some(jsig(sym.info))
+ if (needsJavaSig(sym.info)) {
+ //println("Java sig of "+sym+" is "+jsig2(true, List(), sym.info))//DEBUG
+ Some(jsig2(true, List(), sym.info))
+ }
else None
}