@@ -2634,7 +2634,7 @@ object Types {
2634
2634
def paramNames : List [ThisName ]
2635
2635
def paramInfos : List [PInfo ]
2636
2636
def resType : Type
2637
- def newParamRef (n : Int )( implicit ctx : Context ) : ParamRefType
2637
+ def newParamRef (n : Int ): ParamRefType
2638
2638
2639
2639
override def resultType (implicit ctx : Context ) = resType
2640
2640
@@ -2648,12 +2648,7 @@ object Types {
2648
2648
final def isTypeLambda = isInstanceOf [TypeLambda ]
2649
2649
final def isHigherKinded = isInstanceOf [TypeProxy ]
2650
2650
2651
- private var myParamRefs : List [ParamRefType ] = null
2652
-
2653
- def paramRefs (implicit ctx : Context ): List [ParamRefType ] = {
2654
- if (myParamRefs == null ) myParamRefs = paramNames.indices.toList.map(newParamRef)
2655
- myParamRefs
2656
- }
2651
+ lazy val paramRefs : List [ParamRefType ] = paramNames.indices.toList.map(newParamRef)
2657
2652
2658
2653
protected def computeSignature (implicit ctx : Context ) = resultSignature
2659
2654
@@ -2814,7 +2809,7 @@ object Types {
2814
2809
*/
2815
2810
def isParamDependent (implicit ctx : Context ): Boolean = paramDependencyStatus == TrueDeps
2816
2811
2817
- def newParamRef (n : Int )( implicit ctx : Context ) = TermParamRef (this , n)
2812
+ def newParamRef (n : Int ) = TermParamRef (this , n)
2818
2813
}
2819
2814
2820
2815
abstract case class MethodType (paramNames : List [TermName ])(
@@ -2969,7 +2964,7 @@ object Types {
2969
2964
def isDependent (implicit ctx : Context ): Boolean = true
2970
2965
def isParamDependent (implicit ctx : Context ): Boolean = true
2971
2966
2972
- def newParamRef (n : Int )( implicit ctx : Context ) = TypeParamRef (this , n)
2967
+ def newParamRef (n : Int ) = TypeParamRef (this , n)
2973
2968
2974
2969
lazy val typeParams : List [LambdaParam ] =
2975
2970
paramNames.indices.toList.map(new LambdaParam (this , _))
@@ -3127,7 +3122,7 @@ object Types {
3127
3122
def paramInfoAsSeenFrom (pre : Type )(implicit ctx : Context ) = paramInfo
3128
3123
def paramInfoOrCompleter (implicit ctx : Context ): Type = paramInfo
3129
3124
def paramVariance (implicit ctx : Context ): Int = tl.paramNames(n).variance
3130
- def toArg ( implicit ctx : Context ) : Type = TypeParamRef (tl, n)
3125
+ def toArg : Type = TypeParamRef (tl, n)
3131
3126
def paramRef (implicit ctx : Context ): Type = TypeParamRef (tl, n)
3132
3127
}
3133
3128
@@ -3341,7 +3336,7 @@ object Types {
3341
3336
abstract class BoundType extends CachedProxyType with ValueType {
3342
3337
type BT <: Type
3343
3338
val binder : BT
3344
- def copyBoundType (bt : BT )( implicit ctx : Context ) : Type
3339
+ def copyBoundType (bt : BT ): Type
3345
3340
}
3346
3341
3347
3342
abstract class ParamRef extends BoundType {
@@ -3370,21 +3365,14 @@ object Types {
3370
3365
}
3371
3366
}
3372
3367
3373
- abstract case class TermParamRef (binder : TermLambda , paramNum : Int ) extends ParamRef {
3368
+ case class TermParamRef (binder : TermLambda , paramNum : Int ) extends ParamRef {
3374
3369
type BT = TermLambda
3375
- def copyBoundType (bt : BT )(implicit ctx : Context ) = TermParamRef (bt, paramNum)
3376
- }
3377
-
3378
- class CachedTermParamRef (binder : TermLambda , paramNum : Int ) extends TermParamRef (binder, paramNum)
3379
-
3380
- object TermParamRef {
3381
- def apply (binder : TermLambda , paramNum : Int )(implicit ctx : Context ) =
3382
- unique(new CachedTermParamRef (binder, paramNum))
3370
+ def copyBoundType (bt : BT ) = TermParamRef (bt, paramNum)
3383
3371
}
3384
3372
3385
- abstract case class TypeParamRef (binder : TypeLambda , paramNum : Int ) extends ParamRef {
3373
+ case class TypeParamRef (binder : TypeLambda , paramNum : Int ) extends ParamRef {
3386
3374
type BT = TypeLambda
3387
- def copyBoundType (bt : BT )( implicit ctx : Context ) = TypeParamRef (bt, paramNum)
3375
+ def copyBoundType (bt : BT ) = TypeParamRef (bt, paramNum)
3388
3376
3389
3377
/** Looking only at the structure of `bound`, is one of the following true?
3390
3378
* - fromBelow and param <:< bound
@@ -3400,21 +3388,11 @@ object Types {
3400
3388
}
3401
3389
}
3402
3390
3403
- class ConcreteTypeParamRef (binder : TypeLambda , paramNum : Int ) extends TypeParamRef (binder, paramNum)
3404
-
3405
- object TypeParamRef {
3406
- def apply (binder : TypeLambda , paramNum : Int )(implicit ctx : Context ) =
3407
- unique(new ConcreteTypeParamRef (binder, paramNum))
3408
-
3409
- def uncached (binder : TypeLambda , paramNum : Int ) =
3410
- new ConcreteTypeParamRef (binder : TypeLambda , paramNum : Int )
3411
- }
3412
-
3413
3391
/** a self-reference to an enclosing recursive type. */
3414
3392
case class RecThis (binder : RecType ) extends BoundType with SingletonType {
3415
3393
type BT = RecType
3416
3394
override def underlying (implicit ctx : Context ) = binder
3417
- def copyBoundType (bt : BT )( implicit ctx : Context ) = RecThis (bt)
3395
+ def copyBoundType (bt : BT ) = RecThis (bt)
3418
3396
3419
3397
// need to customize hashCode and equals to prevent infinite recursion
3420
3398
// between RecTypes and RecRefs.
0 commit comments