summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-30 10:25:23 -0700
committerPaul Phillips <paulp@improving.org>2012-03-30 10:42:47 -0700
commit0fae7b9064e44b3ee8041a5e5a19e85abfb32e0c (patch)
tree347c42ac396d8f122fbebd024c2772a80e2060fe /src/compiler
parent0afdb88a5e1cff0202b958a0165b5368114fa0c7 (diff)
downloadscala-0fae7b9064e44b3ee8041a5e5a19e85abfb32e0c.tar.gz
scala-0fae7b9064e44b3ee8041a5e5a19e85abfb32e0c.tar.bz2
scala-0fae7b9064e44b3ee8041a5e5a19e85abfb32e0c.zip
Fix for string bug in genjvm.
It's -Ycheck:jvm, not -Ycheck:genjvm. There is no genjvm.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
index b7b4212b93..7b7135d180 100644
--- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
+++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala
@@ -121,6 +121,9 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
if (settings.debug.value)
inform("[running phase " + name + " on icode]")
+ if (settings.Xverify.value && !SigParser.isParserAvailable)
+ global.warning("signature verification requested by signature parser unavailable: signatures not checked")
+
if (settings.Xdce.value)
for ((sym, cls) <- icodes.classes if inliner.isClosureClass(sym) && !deadCode.liveClosures(sym))
icodes.classes -= sym
@@ -285,6 +288,15 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
val emitLines = debugLevel >= 2
val emitVars = debugLevel >= 3
+ // bug had phase with wrong name; leaving enabled for brief pseudo deprecation
+ private val checkSignatures = (
+ (settings.check containsName phaseName)
+ || (settings.check.value contains "genjvm") && {
+ global.warning("This option will be removed: please use -Ycheck:%s, not -Ycheck:genjvm." format phaseName)
+ true
+ }
+ )
+
/** For given symbol return a symbol corresponding to a class that should be declared as inner class.
*
* For example:
@@ -726,10 +738,10 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
def addGenericSignature(jmember: JMember, sym: Symbol, owner: Symbol) {
if (needsGenericSignature(sym)) {
val memberTpe = beforeErasure(owner.thisType.memberInfo(sym))
- // println("addGenericSignature sym: " + sym.fullName + " : " + memberTpe + " sym.info: " + sym.info)
- // println("addGenericSignature: "+ (sym.ownerChain map (x => (x.name, x.isImplClass))))
+
erasure.javaSig(sym, memberTpe) foreach { sig =>
- debuglog("sig(" + jmember.getName + ", " + sym + ", " + owner + ") " + sig)
+ // This seems useful enough in the general case.
+ log(sig)
/** Since we're using a sun internal class for signature validation,
* we have to allow for it not existing or otherwise malfunctioning:
* in which case we treat every signature as valid. Medium term we
@@ -743,7 +755,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with
""".trim.stripMargin.format(sym, sym.owner.skipPackageObject.fullName, sig))
return
}
- if ((settings.check.value contains "genjvm")) {
+ if (checkSignatures) {
val normalizedTpe = beforeErasure(erasure.prepareSigMap(memberTpe))
val bytecodeTpe = owner.thisType.memberInfo(sym)
if (!sym.isType && !sym.isConstructor && !(erasure.erasure(sym)(normalizedTpe) =:= bytecodeTpe)) {