Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed crash on specialized inner classes.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@18653 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
  • Loading branch information...
commit 64562cd249ebca0698eb8ec77564d7626e377bd8 1 parent f6d7df0
dragos authored
6 src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
View
@@ -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)
10 src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
View
@@ -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'. */
Please sign in to comment.
Something went wrong with that request. Please try again.