Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
@@ -310,7 +310,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
310 310 case _ => false
311 311 }
312 312
313   - (needsIt(sym.tpe)
  313 + (needsIt(sym.info)
314 314 || (isNormalizedMember(sym) && info(sym).typeBoundsIn(env)))
315 315
316 316 }
@@ -733,7 +733,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
733 733
734 734 case ClassInfoType(base, decls, clazz) =>
735 735 // val parents = base map specializedType
736   -// log("set parents of " + clazz + " to: " + parents)
  736 + log("transformInfo " + clazz )
737 737 val res = ClassInfoType(base map specializedType, newScope(specializeClass(clazz, typeEnv(clazz))), clazz)
738 738 res
739 739
@@ -1211,7 +1211,7 @@ abstract class SpecializeTypes extends InfoTransform with TypingTransformers {
1211 1211 /** Cast `tree' to 'pt', unless tpe is a subtype of pt, or pt is Unit. */
1212 1212 def maybeCastTo(pt: Type, tpe: Type, tree: Tree): Tree =
1213 1213 if ((pt == definitions.UnitClass.tpe) || (tpe <:< pt)) {
1214   - log("no need to cast from " + tpe + " to " + pt)
  1214 + //log("no need to cast from " + tpe + " to " + pt)
1215 1215 tree
1216 1216 } else
1217 1217 gen.mkAsInstanceOf(tree, pt)
10 src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
@@ -94,7 +94,15 @@ abstract class Duplicators extends Analyzer {
94 94 def fixType(tpe: Type): Type = {
95 95 val tpe1 = envSubstitution(tpe)
96 96 log("tpe1: " + tpe1)
97   - (new FixInvalidSyms)(tpe1)
  97 + val tpe2: Type = (new FixInvalidSyms)(tpe1)
  98 + val tpe3 = tpe2 match {
  99 + case TypeRef(_, sym, _) if (sym.owner == oldClassOwner) =>
  100 + log("seeing " + sym.fullNameString + " from a different angle")
  101 + tpe2.asSeenFrom(newClassOwner.thisType, oldClassOwner)
  102 + case _ => tpe2
  103 + }
  104 + log("tpe2: " + tpe3)
  105 + tpe3
98 106 }
99 107
100 108 /** Return the new symbol corresponding to `sym'. */

0 comments on commit 64562cd

Please sign in to comment.
Something went wrong with that request. Please try again.