@@ -19,7 +19,7 @@ import Periods._
1919import Designators ._
2020import util .Positions .{Position , NoPosition }
2121import util .Stats ._
22- import util .{ DotClass , SimpleMap }
22+ import util .DotClass
2323import reporting .diagnostic .Message
2424import reporting .diagnostic .messages .CyclicReferenceInvolving
2525import ast .tpd ._
@@ -2602,7 +2602,32 @@ object Types {
26022602 final override def toString = s " $prefixString( $paramNames, $paramInfos, $resType) "
26032603 }
26042604
2605- trait HKLambda extends LambdaType
2605+ abstract class HKLambda extends CachedProxyType with LambdaType {
2606+ final override def underlying (implicit ctx : Context ) = resType
2607+
2608+ final override def computeHash = doHash(paramNames, resType, paramInfos)
2609+
2610+ final override def equals (that : Any ) = that match {
2611+ case that : HKLambda =>
2612+ paramNames == that.paramNames &&
2613+ paramInfos == that.paramInfos &&
2614+ resType == that.resType &&
2615+ companion.eq(that.companion)
2616+ case _ =>
2617+ false
2618+ }
2619+
2620+ final override def eql (that : Type ) = that match {
2621+ case that : HKLambda =>
2622+ paramNames.equals(that.paramNames) &&
2623+ paramInfos.equals(that.paramInfos) &&
2624+ resType.equals(that.resType) &&
2625+ companion.eq(that.companion)
2626+ case _ =>
2627+ false
2628+ }
2629+ }
2630+
26062631 trait MethodOrPoly extends LambdaType with MethodicType
26072632
26082633 trait TermLambda extends LambdaType { thisLambdaType =>
@@ -2893,7 +2918,7 @@ object Types {
28932918 */
28942919 class HKTypeLambda (val paramNames : List [TypeName ])(
28952920 paramInfosExp : HKTypeLambda => List [TypeBounds ], resultTypeExp : HKTypeLambda => Type )
2896- extends UncachedProxyType with HKLambda with TypeLambda {
2921+ extends HKLambda with TypeLambda {
28972922 type This = HKTypeLambda
28982923 def companion = HKTypeLambda
28992924
@@ -2903,8 +2928,6 @@ object Types {
29032928 assert(resType.isInstanceOf [TermType ], this )
29042929 assert(paramNames.nonEmpty)
29052930
2906- final override def underlying (implicit ctx : Context ) = resType
2907-
29082931 protected def prefixString = " HKTypeLambda"
29092932 }
29102933
0 commit comments