From 5a9a48d21038b78545aba15d0d99238c3c395d47 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 20 Jul 2015 12:15:27 +0200 Subject: Remove magic from derivedRefinedType. It's no longer needed with new hk scheme. --- src/dotty/tools/dotc/core/Types.scala | 20 +++----------------- 1 file changed, 3 insertions(+), 17 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 4656b0629..312d6b290 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -1872,23 +1872,9 @@ object Types { this } - /** Derived refined type, with a twist: A refinement with a higher-kinded type param placeholder - * is transformed to a refinement of the original type parameter if that one exists. - */ - def derivedRefinedType(parent: Type, refinedName: Name, refinedInfo: Type)(implicit ctx: Context): RefinedType = { - lazy val underlyingTypeParams = parent.rawTypeParams - - if ((parent eq this.parent) && (refinedName eq this.refinedName) && (refinedInfo eq this.refinedInfo)) - this - else if ( refinedName.isLambdaArgName - //&& { println(s"deriving $refinedName $parent $underlyingTypeParams"); true } - && refinedName.LambdaArgIndex < underlyingTypeParams.length - && !parent.isLambda) - derivedRefinedType(parent.EtaExpand, refinedName, refinedInfo) - else - if (false) RefinedType(parent, refinedName, refinedInfo) - else RefinedType(parent, refinedName, rt => refinedInfo.substRefinedThis(this, RefinedThis(rt))) - } + def derivedRefinedType(parent: Type, refinedName: Name, refinedInfo: Type)(implicit ctx: Context): RefinedType = + if ((parent eq this.parent) && (refinedName eq this.refinedName) && (refinedInfo eq this.refinedInfo)) this + else RefinedType(parent, refinedName, rt => refinedInfo.substRefinedThis(this, RefinedThis(rt))) /** Add this refinement to `parent`, provided If `refinedName` is a member of `parent`. */ def wrapIfMember(parent: Type)(implicit ctx: Context): Type = -- cgit v1.2.3