diff options
Diffstat (limited to 'src/dotty/tools/dotc/core')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/TypeOps.scala | 2 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index d4db07ef2..8e068f5d3 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -33,7 +33,7 @@ class TypeApplications(val self: Type) extends AnyVal { case tp: TypeRef => val tsym = tp.typeSymbol if (tsym.isClass) tsym.typeParams - else if (tsym.isAliasType) tp.underlying.typeParams + else if (tsym.info.isAlias) tp.underlying.typeParams else tp.info.bounds.hi match { case AndType(hkBound, other) if defn.hkTraits contains hkBound.typeSymbol => hkBound.typeSymbol.typeParams diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala index f3ddf3cc1..e2352d89e 100644 --- a/src/dotty/tools/dotc/core/TypeOps.scala +++ b/src/dotty/tools/dotc/core/TypeOps.scala @@ -165,7 +165,7 @@ trait TypeOps { this: Context => formals = formals.updated(name, tp1.typeParamNamed(name)) normalizeToRef(tp1) case tp: TypeRef => - if (tp.symbol.isAliasType) normalizeToRef(tp.info.bounds.hi) + if (tp.symbol.info.isAlias) normalizeToRef(tp.info.bounds.hi) else tp case ErrorType => defn.AnyClass.typeRef diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 9d6faef75..b628d9c50 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -173,9 +173,16 @@ object Types { final def occursIn(that: Type)(implicit ctx: Context): Boolean = that existsPart (this == _) + /** Is this a type of a repeated parameter? */ def isRepeatedParam(implicit ctx: Context): Boolean = defn.RepeatedParamClasses contains typeSymbol + /** Is this an alias TypeBounds? */ + def isAlias: Boolean = this match { + case TypeBounds(lo, hi) => lo eq hi + case _ => false + } + // ----- Higher-order combinators ----------------------------------- /** Returns true if there is a part of this type that satisfies predicate `p`. @@ -672,7 +679,7 @@ object Types { */ final def normalizedPrefix(implicit ctx: Context): Type = this match { case tp: NamedType => - if (tp.symbol.isAliasType) tp.info.normalizedPrefix else tp.prefix + if (tp.symbol.info.isAlias) tp.info.normalizedPrefix else tp.prefix case tp: ClassInfo => tp.prefix case tp: TypeProxy => |