@@ -2654,7 +2654,6 @@ object Types {
2654
2654
final def isHigherKinded = isInstanceOf [TypeProxy ]
2655
2655
2656
2656
private [this ] var myParamRefs : List [ParamRefType ] = null
2657
- private [this ] var myStableHash : Byte = 0
2658
2657
2659
2658
def paramRefs : List [ParamRefType ] = {
2660
2659
if (myParamRefs == null ) myParamRefs = paramNames.indices.toList.map(newParamRef)
@@ -2687,20 +2686,24 @@ object Types {
2687
2686
x => paramInfos.mapConserve(_.subst(this , x).asInstanceOf [PInfo ]),
2688
2687
x => resType.subst(this , x))
2689
2688
2689
+ protected def prefixString : String
2690
+ final override def toString = s " $prefixString( $paramNames, $paramInfos, $resType) "
2691
+ }
2692
+
2693
+ abstract class HKLambda extends CachedProxyType with LambdaType {
2694
+ final override def underlying (implicit ctx : Context ) = resType
2695
+
2690
2696
override def computeHash (bs : Binders ) =
2691
2697
doHash(new Binders (this , bs), paramNames, resType, paramInfos)
2692
2698
2693
- override def stableHash = {
2694
- if (myStableHash == 0 ) myStableHash = if (resType.stableHash && paramInfos.stableHash) 1 else - 1
2695
- myStableHash > 0
2696
- }
2699
+ override def stableHash = resType.stableHash && paramInfos.stableHash
2697
2700
2698
2701
final override def equals (that : Any ) = equals(that, null )
2699
2702
2700
2703
// No definition of `eql` --> fall back on equals, which calls iso
2701
2704
2702
2705
final override def iso (that : Any , bs : BinderPairs ) = that match {
2703
- case that : LambdaType =>
2706
+ case that : HKLambda =>
2704
2707
paramNames.eqElements(that.paramNames) &&
2705
2708
companion.eq(that.companion) && {
2706
2709
val bs1 = new BinderPairs (this , that, bs)
@@ -2710,17 +2713,13 @@ object Types {
2710
2713
case _ =>
2711
2714
false
2712
2715
}
2713
-
2714
- protected def prefixString : String
2715
- final override def toString = s " $prefixString( $paramNames, $paramInfos, $resType) "
2716
2716
}
2717
2717
2718
- abstract class HKLambda extends CachedProxyType with LambdaType {
2719
- final override def underlying (implicit ctx : Context ) = resType
2718
+ abstract class MethodOrPoly extends UncachedGroundType with LambdaType with MethodicType {
2719
+ final override def hashCode = System .identityHashCode(this )
2720
+ final override def equals (other : Any ) = this `eq` other.asInstanceOf [AnyRef ]
2720
2721
}
2721
2722
2722
- abstract class MethodOrPoly extends CachedGroundType with LambdaType with MethodicType
2723
-
2724
2723
trait TermLambda extends LambdaType { thisLambdaType =>
2725
2724
import DepStatus ._
2726
2725
type ThisName = TermName
0 commit comments