@@ -470,10 +470,8 @@ object Types {
470470 final def memberExcluding (name : Name , excluding : FlagSet )(implicit ctx : Context ): Denotation = {
471471 // We need a valid prefix for `asSeenFrom`
472472 val pre = this match {
473- case tp : ClassInfo =>
474- tp.typeRef // @!!! appliedRef
475- case _ =>
476- widenIfUnstable
473+ case tp : ClassInfo => tp.appliedRef
474+ case _ => widenIfUnstable
477475 }
478476 findMember(name, pre, excluding)
479477 }
@@ -3432,48 +3430,25 @@ object Types {
34323430 decls : Scope ,
34333431 selfInfo : DotClass /* should be: Type | Symbol */ ) extends CachedGroundType with TypeType {
34343432
3433+ private var selfTypeCache : Type = null
3434+ private var appliedRefCache : Type = null
3435+
34353436 /** The self type of a class is the conjunction of
34363437 * - the explicit self type if given (or the info of a given self symbol), and
34373438 * - the fully applied reference to the class itself.
34383439 */
34393440 def selfType (implicit ctx : Context ): Type = {
34403441 if (selfTypeCache == null )
34413442 selfTypeCache = {
3442- def fullRef = fullyAppliedRef
34433443 val given = cls.givenSelfType
3444- val raw =
3445- if (! given .exists) fullRef
3446- else if (cls is Module ) given
3447- else if (ctx.erasedTypes) fullRef
3448- else AndType (given , fullRef)
3449- raw// .asSeenFrom(prefix, cls.owner)
3444+ if (! given .exists) appliedRef
3445+ else if (cls is Module ) given
3446+ else if (ctx.erasedTypes) appliedRef
3447+ else AndType (given , appliedRef)
34503448 }
34513449 selfTypeCache
34523450 }
34533451
3454- private var selfTypeCache : Type = null
3455-
3456- // private def fullyAppliedRef(base: Type, tparams: List[TypeSymbol])(implicit ctx: Context): Type =
3457- // base.appliedTo(tparams.map(_.typeRef))
3458-
3459- /** The class type with all type parameters */
3460- def fullyAppliedRef (implicit ctx : Context ): Type = // @!!! eliminate
3461- // if (true)
3462- cls.appliedRef
3463- // else fullyAppliedRef(cls.typeRef, cls.typeParams)
3464-
3465- private var appliedRefCache : Type = null
3466- private var typeRefCache : TypeRef = null
3467-
3468- def typeRef (implicit ctx : Context ): TypeRef = {
3469- def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this )
3470- if (typeRefCache == null )
3471- typeRefCache =
3472- if ((cls is PackageClass ) || cls.owner.isTerm) symbolicTypeRef
3473- else TypeRef (prefix, cls.name, clsDenot)
3474- typeRefCache
3475- }
3476-
34773452 def appliedRef (implicit ctx : Context ): Type = {
34783453 def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this )
34793454 if (appliedRefCache == null ) {
0 commit comments