From 321ecd84d8970acc43523280267595567b9a0ecb Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 27 Jul 2011 20:59:50 +0000 Subject: Debug output to help with signature issues. comments into code comments for reference by me or some lucky future person. No review. --- src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala | 8 ++++++++ src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala | 10 +++++++--- src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala | 1 + 3 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala index 2b635e032a..7c24c6338b 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala @@ -51,6 +51,14 @@ abstract class ICodeCheckers { * * @todo Better checks for MONITOR_ENTER/EXIT * Better checks for local var initializations + * + * @todo Iulian says: I think there's some outdated logic in the checker. + * The issue with exception handlers being special for least upper + * bounds pointed out some refactoring in the lattice class. Maybe + * a worthwhile refactoring would be to make the checker use the + * DataFlowAnalysis class, and use the lattice trait. In the + * implementation of LUB, there's a flag telling if one of the + * successors is 'exceptional'. The inliner is using this mechanism. */ class ICodeChecker { import icodes._ diff --git a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala index 10f01a5d37..fb5a93fdc8 100644 --- a/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala +++ b/src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala @@ -380,12 +380,16 @@ trait TypeKinds { self: ICodes => case TypeRef(_, sym, args) => primitiveOrClassType(sym, args) case ClassInfoType(_, _, ArrayClass) => abort("ClassInfoType to ArrayClass!") case ClassInfoType(_, _, sym) => primitiveOrRefType(sym) + + // !!! Iulian says types which make no sense after erasure should not reach here, + // which includes the ExistentialType, AnnotatedType, RefinedType. I don't know + // if the first two cases exist because they do or as a defensive measure, but + // at the time I added it, RefinedTypes were indeed reaching here. case ExistentialType(_, t) => toTypeKind(t) case AnnotatedType(_, t, _) => toTypeKind(t) - // PP to ID: I added RefinedType here, is this OK or should they never be - // allowed to reach here? case RefinedType(parents, _) => parents map toTypeKind reduceLeft lub - // bq: useful hack when wildcard types come here + // For sure WildcardTypes shouldn't reach here either, but when + // debugging such situations this may come in handy. // case WildcardType => REFERENCE(ObjectClass) case norm => abort( "Unknown type: %s, %s [%s, %s] TypeRef? %s".format( diff --git a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala index 7c382c5f93..ac76f97b77 100644 --- a/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala +++ b/src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala @@ -577,6 +577,7 @@ abstract class GenJVM extends SubComponent with GenJVMUtil with GenAndroid with // 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) /** 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 -- cgit v1.2.3