diff options
-rw-r--r-- | src/dotty/tools/dotc/core/Symbols.scala | 3 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/TypeComparer.scala | 16 | ||||
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 1 |
3 files changed, 12 insertions, 8 deletions
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala index 2be97691f..2854d7d2f 100644 --- a/src/dotty/tools/dotc/core/Symbols.scala +++ b/src/dotty/tools/dotc/core/Symbols.scala @@ -256,6 +256,9 @@ trait Symbols { this: Context => tparams } + /** Create a new skolem symbol. This is not the same as SkolemType, even thouggh the + * motivation (create a singleton referencing to a type)= is similar. + */ def newSkolem(tp: Type) = newSymbol(defn.RootClass, nme.SKOLEM, SyntheticArtifact | Permanent, tp) def newErrorSymbol(owner: Symbol, name: Name) = diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala index 05edad59b..0d2dc20d3 100644 --- a/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/src/dotty/tools/dotc/core/TypeComparer.scala @@ -932,14 +932,14 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi case tp1: TypeBounds => tp2 match { case tp2: TypeBounds => tp1 & tp2 + case tp2: ClassInfo if tp1 contains tp2.typeRef => tp2 case _ => andConflict(tp1, tp2) } case tp1: ClassInfo => tp2 match { - case tp2: ClassInfo if tp1.cls eq tp2.cls => - tp1.derivedClassInfo(tp1.prefix & tp2.prefix) - case _ => - andConflict(tp1, tp2) + case tp2: ClassInfo if tp1.cls eq tp2.cls => tp1.derivedClassInfo(tp1.prefix & tp2.prefix) + case tp2: TypeBounds if tp2 contains tp1.typeRef => tp1 + case _ => andConflict(tp1, tp2) } case tp1 @ MethodType(names1, formals1) => tp2 match { @@ -997,14 +997,14 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi case tp1: TypeBounds => tp2 match { case tp2: TypeBounds => tp1 | tp2 + case tp2: ClassInfo if tp1 contains tp2.typeRef => tp1 case _ => orConflict(tp1, tp2) } case tp1: ClassInfo => tp2 match { - case tp2: ClassInfo if tp1.cls eq tp2.cls => - tp1.derivedClassInfo(tp1.prefix | tp2.prefix) - case _ => - orConflict(tp1, tp2) + case tp2: ClassInfo if tp1.cls eq tp2.cls => tp1.derivedClassInfo(tp1.prefix | tp2.prefix) + case tp2: TypeBounds if tp2 contains tp1.typeRef => tp2 + case _ => orConflict(tp1, tp2) } case tp1 @ MethodType(names1, formals1) => tp2 match { diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 0363a8c70..8249e5a4c 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -2151,6 +2151,7 @@ object Types { } } + /** TODO Some docs would be nice here! */ case class PolyParam(binder: PolyType, paramNum: Int) extends ParamType { type BT = PolyType def copyBoundType(bt: BT) = PolyParam(bt, paramNum) |