summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2009-09-07 15:56:32 +0000
committerIulian Dragos <jaguarul@gmail.com>2009-09-07 15:56:32 +0000
commit3335e037a83edef65eb3c6fa75be23c0d0a46aab (patch)
tree1dc126af4954bd4027278c2b680fab1fcc00272a /src
parentc980b574ba8747d7f0adbeaf1e53fb3850dae840 (diff)
downloadscala-3335e037a83edef65eb3c6fa75be23c0d0a46aab.tar.gz
scala-3335e037a83edef65eb3c6fa75be23c0d0a46aab.tar.bz2
scala-3335e037a83edef65eb3c6fa75be23c0d0a46aab.zip
Fixed crash on specialized inner classes.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala6
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Duplicators.scala10
2 files changed, 12 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
index 5404e58992..ea2420ac79 100644
--- a/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
+++ b/src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
@@ -310,7 +310,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
case _ => false
}
- (needsIt(sym.tpe)
+ (needsIt(sym.info)
|| (isNormalizedMember(sym) && info(sym).typeBoundsIn(env)))
}
@@ -733,7 +733,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
case ClassInfoType(base, decls, clazz) =>
// val parents = base map specializedType
-// log("set parents of " + clazz + " to: " + parents)
+ log("transformInfo " + clazz )
val res = ClassInfoType(base map specializedType, newScope(specializeClass(clazz, typeEnv(clazz))), clazz)
res
@@ -1211,7 +1211,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
/** Cast `tree' to 'pt', unless tpe is a subtype of pt, or pt is Unit. */
def maybeCastTo(pt: Type, tpe: Type, tree: Tree): Tree =
if ((pt == definitions.UnitClass.tpe) || (tpe <:< pt)) {
- log("no need to cast from " + tpe + " to " + pt)
+ //log("no need to cast from " + tpe + " to " + pt)
tree
} else
gen.mkAsInstanceOf(tree, pt)
diff --git a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
index 8a4a6129fb..0c0f1bf305 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -94,7 +94,15 @@ abstract class Duplicators extends Analyzer {
def fixType(tpe: Type): Type = {
val tpe1 = envSubstitution(tpe)
log("tpe1: " + tpe1)
- (new FixInvalidSyms)(tpe1)
+ val tpe2: Type = (new FixInvalidSyms)(tpe1)
+ val tpe3 = tpe2 match {
+ case TypeRef(_, sym, _) if (sym.owner == oldClassOwner) =>
+ log("seeing " + sym.fullNameString + " from a different angle")
+ tpe2.asSeenFrom(newClassOwner.thisType, oldClassOwner)
+ case _ => tpe2
+ }
+ log("tpe2: " + tpe3)
+ tpe3
}
/** Return the new symbol corresponding to `sym'. */