@@ -1193,15 +1193,6 @@ object Types {
11931193 NoType
11941194 }
11951195
1196- /** For a ClassInfo type, its parents,
1197- * Inherited by all type proxies. Empty for all other types.
1198- * Overwritten in ClassInfo, where parents is cached.
1199- */
1200- def parentRefs (implicit ctx : Context ): List [TypeRef ] = this match {
1201- case tp : TypeProxy => tp.underlying.parentRefs
1202- case _ => Nil
1203- }
1204-
12051196 /** The full parent types, including all type arguments */
12061197 def parentsWithArgs (implicit ctx : Context ): List [Type ] = this match {
12071198 case tp : TypeProxy => tp.superType.parentsWithArgs
@@ -1224,8 +1215,8 @@ object Types {
12241215 }
12251216
12261217 /** The first parent of this type, AnyRef if list of parents is empty */
1227- def firstParentRef (implicit ctx : Context ): TypeRef = parentRefs match {
1228- case p :: _ => p
1218+ def firstParentRef (implicit ctx : Context ): TypeRef = parentsNEW match { // @!!! needed?
1219+ case p :: _ => p.typeConstructor. asInstanceOf [ TypeRef ]
12291220 case _ => defn.AnyType
12301221 }
12311222
@@ -3559,7 +3550,7 @@ object Types {
35593550 abstract case class ClassInfo (
35603551 prefix : Type ,
35613552 cls : ClassSymbol ,
3562- classParentsNEW : List [Type ],
3553+ classParents : List [Type ],
35633554 decls : Scope ,
35643555 selfInfo : DotClass /* should be: Type | Symbol */ ) extends CachedGroundType with TypeType {
35653556
@@ -3622,30 +3613,26 @@ object Types {
36223613 // cached because baseType needs parents
36233614 private var parentsCache : List [Type ] = null
36243615
3625- /** The parent type refs as seen from the given prefix */
3626- override def parentRefs (implicit ctx : Context ): List [TypeRef ] =
3627- parentsNEW.map(_.typeConstructor.asInstanceOf [TypeRef ])
3628-
36293616 /** The parent types with all type arguments */
36303617 override def parentsWithArgs (implicit ctx : Context ): List [Type ] = parentsNEW
36313618
36323619 override def parentsNEW (implicit ctx : Context ): List [Type ] = {
36333620 if (parentsCache == null )
3634- parentsCache = classParentsNEW .mapConserve(_.asSeenFrom(prefix, cls.owner))
3621+ parentsCache = classParents .mapConserve(_.asSeenFrom(prefix, cls.owner))
36353622 parentsCache
36363623 }
36373624
36383625 def derivedClassInfo (prefix : Type )(implicit ctx : Context ) =
36393626 if (prefix eq this .prefix) this
3640- else ClassInfo (prefix, cls, classParentsNEW , decls, selfInfo)
3627+ else ClassInfo (prefix, cls, classParents , decls, selfInfo)
36413628
3642- def derivedClassInfo (prefix : Type = this .prefix, classParentsNEW : List [Type ] = this .classParentsNEW , decls : Scope = this .decls, selfInfo : DotClass = this .selfInfo)(implicit ctx : Context ) =
3643- if ((prefix eq this .prefix) && (classParentsNEW eq this .classParentsNEW ) && (decls eq this .decls) && (selfInfo eq this .selfInfo)) this
3644- else ClassInfo (prefix, cls, classParentsNEW , decls, selfInfo)
3629+ def derivedClassInfo (prefix : Type = this .prefix, classParents : List [Type ] = this .classParents , decls : Scope = this .decls, selfInfo : DotClass = this .selfInfo)(implicit ctx : Context ) =
3630+ if ((prefix eq this .prefix) && (classParents eq this .classParents ) && (decls eq this .decls) && (selfInfo eq this .selfInfo)) this
3631+ else ClassInfo (prefix, cls, classParents , decls, selfInfo)
36453632
36463633 override def computeHash = doHash(cls, prefix)
36473634
3648- override def toString = s " ClassInfo( $prefix, $cls, $classParentsNEW ) "
3635+ override def toString = s " ClassInfo( $prefix, $cls, $classParents ) "
36493636 }
36503637
36513638 class CachedClassInfo (prefix : Type , cls : ClassSymbol , classParents : List [Type ], decls : Scope , selfInfo : DotClass )
@@ -3663,9 +3650,9 @@ object Types {
36633650
36643651 def addSuspension (suspension : Context => Unit ): Unit = suspensions ::= suspension
36653652
3666- /** Install classinfo with known parents in `denot` and resume all suspensions */
3653+ /** Install classinfo with known parents in `denot` and resume all suspensions */ // @!!! elim
36673654 def finalize (denot : SymDenotation , parents : List [Type ])(implicit ctx : Context ) = {
3668- denot.info = derivedClassInfo(classParentsNEW = parents)
3655+ denot.info = derivedClassInfo(classParents = parents)
36693656 suspensions.foreach(_(ctx))
36703657 }
36713658
0 commit comments