From d0f82a50bffc059803b56a341c8fcd9a238431f7 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 3 Jun 2016 18:42:23 +0200 Subject: Don't map info of SkolemTypes in type maps Mapping the info may create new skolems which undermines the idea of a skolem as a fixed reference. In a sense, SkolemTypes are like Termrefs, mapping them does not map their info either. Creating new skolems on the fly in type maps caused some hard find to infinite loops under the new hk scheme. --- src/dotty/tools/dotc/core/Types.scala | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index e4132bf4d..4f5bec56b 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -3333,8 +3333,6 @@ object Types { tp.derivedSuperType(thistp, supertp) protected def derivedAndOrType(tp: AndOrType, tp1: Type, tp2: Type): Type = tp.derivedAndOrType(tp1, tp2) - protected def derivedSkolemType(tp: SkolemType, info: Type): Type = - tp.derivedSkolemType(info) protected def derivedAnnotatedType(tp: AnnotatedType, underlying: Type, annot: Annotation): Type = tp.derivedAnnotatedType(underlying, annot) protected def derivedWildcardType(tp: WildcardType, bounds: Type): Type = @@ -3419,7 +3417,7 @@ object Types { derivedAndOrType(tp, this(tp.tp1), this(tp.tp2)) case tp: SkolemType => - derivedSkolemType(tp, this(tp.info)) + tp case tp @ AnnotatedType(underlying, annot) => val underlying1 = this(underlying) @@ -3522,9 +3520,6 @@ object Types { if (tp1.exists && tp2.exists) tp.derivedAndOrType(tp1, tp2) else if (tp.isAnd) approx(hi = tp1 & tp2) // if one of tp1d, tp2d exists, it is the result of tp1d & tp2d else approx(lo = tp1 & tp2) - override protected def derivedSkolemType(tp: SkolemType, info: Type) = - if (info.exists) tp.derivedSkolemType(info) - else NoType override protected def derivedAnnotatedType(tp: AnnotatedType, underlying: Type, annot: Annotation) = if (underlying.exists) tp.derivedAnnotatedType(underlying, annot) else NoType -- cgit v1.2.3