summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala11
-rw-r--r--src/compiler/scala/tools/nsc/transform/Erasure.scala4
2 files changed, 9 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index fb253d1ddc..b8aa8d7a8f 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -573,9 +573,9 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid {
* should certainly write independent signature validation.
*/
if (SigParser.isParserAvailable && isValidSignature(sym, sig)) {
- val normalizedTpe = erasure.prepareSigMap(memberTpe)
+ val normalizedTpe = atPhase(currentRun.erasurePhase)(erasure.prepareSigMap(memberTpe))
val bytecodeTpe = owner.thisType.memberInfo(sym)
- if (erasure.erasure(normalizedTpe) =:= bytecodeTpe) {
+ if (sym.isType || (erasure.erasure(normalizedTpe) =:= bytecodeTpe)) {
val index = jmember.getConstantPool.addUtf8(sig).toShort
if (opt.verboseDebug)
atPhase(currentRun.erasurePhase) {
@@ -584,12 +584,17 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid {
val buf = ByteBuffer.allocate(2)
buf putShort index
addAttribute(jmember, tpnme.SignatureATTR, buf)
- } else clasz.cunit.warning(sym.pos,
+ } else {
+ if (sym.hasFlag(Flags.MIXEDIN))
+ ()// println("suppressing signature for mixedin "+sym)
+ else
+ clasz.cunit.warning(sym.pos,
"""|compiler bug: created generic signature for %s in %s that does not conform to its erasure
|signature: %s
|erasure type: %s
|if this is reproducible, please report bug at http://lampsvn.epfl.ch/trac/scala
""".trim.stripMargin.format(sym, sym.owner.skipPackageObject.fullName, sig, bytecodeTpe))
+ }
} else clasz.cunit.warning(sym.pos,
"""|compiler bug: created invalid generic signature for %s in %s
|signature: %s
diff --git a/src/compiler/scala/tools/nsc/transform/Erasure.scala b/src/compiler/scala/tools/nsc/transform/Erasure.scala
index 00ef2279d6..bdc0a1bfac 100644
--- a/src/compiler/scala/tools/nsc/transform/Erasure.scala
+++ b/src/compiler/scala/tools/nsc/transform/Erasure.scala
@@ -254,7 +254,7 @@ abstract class Erasure extends AddInterfaces
else squashBoxed(tp1)
}
if (sym == ArrayClass && args.nonEmpty)
- if (unboundedGenericArrayLevel(tp) == 1) ObjectClass.tpe
+ if (unboundedGenericArrayLevel(tp1) == 1) ObjectClass.tpe
else mapOver(tp1)
else if (sym == AnyClass || sym == AnyValClass || sym == SingletonClass)
ObjectClass.tpe
@@ -353,8 +353,6 @@ abstract class Erasure extends AddInterfaces
jsig(RuntimeNothingClass.tpe)
else if (sym == NullClass)
jsig(RuntimeNullClass.tpe)
- else if (isValueClass(sym))
- jsig(ObjectClass.tpe)
else if (sym.isClass) {
val preRebound = pre.baseType(sym.owner) // #2585
traceSig.seq("sym.isClass", Seq(sym.ownerChain, preRebound, sym0.enclClassChain)) {