summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-27 20:59:50 +0000
committerPaul Phillips <paulp@improving.org>2011-07-27 20:59:50 +0000
commit321ecd84d8970acc43523280267595567b9a0ecb (patch)
tree269404e9650988906085fe1105c7c8cd94405e52 /src/compiler
parentac0bfa6220835723498a2f387b803fe8cd87b68d (diff)
downloadscala-321ecd84d8970acc43523280267595567b9a0ecb.tar.gz
scala-321ecd84d8970acc43523280267595567b9a0ecb.tar.bz2
scala-321ecd84d8970acc43523280267595567b9a0ecb.zip
Debug output to help with signature issues.
comments into code comments for reference by me or some lucky future person. No review.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/ICodeCheckers.scala8
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/TypeKinds.scala10
-rw-r--r--src/compiler/scala/tools/nsc/backend/jvm/GenJVM.scala1
3 files changed, 16 insertions, 3 deletions
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 <code>MONITOR_ENTER/EXIT</code>
* 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