aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala7
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala2
-rw-r--r--src/dotty/tools/dotc/core/TypeComparers.scala7
-rw-r--r--src/dotty/tools/dotc/core/Types.scala45
4 files changed, 8 insertions, 53 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index a9da9806e..8dbf43f00 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -387,6 +387,7 @@ object SymDenotations {
typeConstructorCache
}
+ /*
private var typeTemplateCache: Type = null
def typeTemplate(implicit ctx: Context): Type = {
@@ -394,7 +395,7 @@ object SymDenotations {
AppliedType.make(typeConstructor, typeParams map (_.typeConstructor))
typeTemplateCache
}
-
+*/
private var baseClassesVar: List[ClassSymbol] = null
private var superClassBitsVar: BitSet = null
@@ -534,8 +535,6 @@ object SymDenotations {
final def baseTypeOf(tp: Type)(implicit ctx: Context): Type = {
def computeBaseTypeOf(tp: Type): Type = tp match {
- case AppliedType(tycon, args) =>
- baseTypeOf(tycon).subst(tycon.typeParams, args)
case tp: TypeProxy =>
baseTypeOf(tp.underlying)
case AndType(tp1, tp2) =>
@@ -547,7 +546,7 @@ object SymDenotations {
case p :: ps1 => reduce(bt & baseTypeOf(p), ps1)
case _ => bt
}
- if (classd.symbol == symbol) tp.typeTemplate
+ if (classd.symbol == symbol) tp.typeConstructor // was: typeTemplate
else reduce(NoType, classd.parents).substThis(classd.symbol, tp.prefix)
}
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index decdb6c84..84ffc53a7 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -228,7 +228,7 @@ object Symbols {
def baseClasses(implicit ctx: Context): List[ClassSymbol] = classDenot.baseClasses
override def typeConstructor(implicit ctx: Context): Type = classDenot.typeConstructor
- override def typeTemplate(implicit ctx: Context): Type = classDenot.typeTemplate
+// override def typeTemplate(implicit ctx: Context): Type = classDenot.typeTemplate
def superId(implicit ctx: Context): Int = {
val hint = superIdHint
diff --git a/src/dotty/tools/dotc/core/TypeComparers.scala b/src/dotty/tools/dotc/core/TypeComparers.scala
index 304bd9938..22ba680ca 100644
--- a/src/dotty/tools/dotc/core/TypeComparers.scala
+++ b/src/dotty/tools/dotc/core/TypeComparers.scala
@@ -117,11 +117,6 @@ object TypeComparers {
def thirdTry(tp1: Type, tp2: Type): Boolean = tp2 match {
case tp2: TypeRef =>
thirdTryRef(tp1, tp2)
- case AppliedType(tycon, targs) =>
- val clazz2 = tycon.typeSymbol
- val base = tp1.baseType(clazz2)
- base.exists && isSubArgs(base.typeArgs, tp2.typeArgs, clazz2.typeParams) ||
- fourthTry(tp1, tp2)
case tp2: RefinedType1 =>
isSubType(tp1, tp2.parent) &&
isSubType(tp1.member(tp2.name1).info, tp2.info1)
@@ -169,7 +164,7 @@ object TypeComparers {
case TypeBounds(lo1, hi1) =>
isSubType(lo2, lo1) && isSubType(hi1, hi2)
case tp1: ClassInfo =>
- val tt = tp1.typeTemplate
+ val tt = tp1.typeConstructor // was typeTemplate
lo2 <:< tt && tt <:< hi2
case _ =>
false
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 09efd28c0..d55afcca6 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -420,31 +420,14 @@ object Types {
/** The type parameters of this type are:
* For a ClassInfo type, the type parameters of its denotation.
- * For an applied type, the type parameters of its constructor
- * that have not been instantiated yet.
* Inherited by type proxies.
* Empty list for all other types.
*/
final def typeParams(implicit ctx: Context): List[TypeSymbol] = this match {
- case tp: AppliedType =>
- tp.tycon.typeParams drop tp.targs.length
- case tp: TypeProxy =>
- tp.underlying.typeParams
case tp: ClassInfo =>
tp.classd.typeParams
- case _ => Nil
- }
-
- /** The type arguments of this type are:
- * For an Applied type, its type arguments.
- * Inherited by type proxies.
- * Empty list for all other types.
- */
- final def typeArgs(implicit ctx: Context): List[Type] = this match {
- case tp: AppliedType =>
- tp.targs
case tp: TypeProxy =>
- tp.underlying.typeArgs
+ tp.underlying.typeParams
case _ => Nil
}
@@ -735,28 +718,6 @@ object Types {
unique(new CachedConstantType(value))
}
- // --- AppliedType -----------------------------------------------------------------
-
- abstract case class AppliedType(tycon: Type, targs: List[Type]) extends CachedProxyType {
-
- override def underlying(implicit ctx: Context) = tycon
-
- def derivedAppliedType(tycon: Type, targs: List[Type])(implicit ctx: Context): Type =
- if ((tycon eq this.tycon) && (targs eq this.targs)) this
- else AppliedType(tycon, targs)
-
- override def computeHash = doHash(tycon, targs)
- }
-
- final class CachedAppliedType(tycon: Type, targs: List[Type]) extends AppliedType(tycon, targs)
-
- object AppliedType {
- def apply(tycon: Type, targs: List[Type])(implicit ctx: Context) =
- unique(new CachedAppliedType(tycon, targs))
- def make(tycon: Type, targs: List[Type])(implicit ctx: Context) =
- if (targs.isEmpty) tycon else apply(tycon, targs)
- }
-
// --- Refined Type ---------------------------------------------------------
abstract case class RefinedType(parent: Type) extends CachedProxyType with BindingType {
@@ -1042,9 +1003,9 @@ object Types {
abstract case class ClassInfo(prefix: Type, classd: ClassDenotation) extends CachedGroundType {
- def typeTemplate(implicit ctx: Context): Type =
+/* def typeTemplate(implicit ctx: Context): Type =
classd.typeTemplate asSeenFrom (prefix, classd.symbol)
-
+*/
def typeConstructor(implicit ctx: Context): Type =
NamedType(prefix, classd.symbol.name)