@@ -2355,7 +2355,7 @@ object Types {
2355
2355
private [this ] var myRecThis : RecThis = null
2356
2356
2357
2357
def recThis : RecThis = {
2358
- if (myRecThis == null ) myRecThis = new RecThis (this ) {}
2358
+ if (myRecThis == null ) myRecThis = new RecThisImpl (this )
2359
2359
myRecThis
2360
2360
}
2361
2361
@@ -2849,7 +2849,7 @@ object Types {
2849
2849
*/
2850
2850
def isParamDependent (implicit ctx : Context ): Boolean = paramDependencyStatus == TrueDeps
2851
2851
2852
- def newParamRef (n : Int ) = new TermParamRef (this , n) {}
2852
+ def newParamRef (n : Int ): TermParamRef = new TermParamRefImpl (this , n)
2853
2853
2854
2854
/** The least supertype of `resultType` that does not contain parameter dependencies */
2855
2855
def nonDependentResultApprox (implicit ctx : Context ): Type =
@@ -3008,7 +3008,7 @@ object Types {
3008
3008
def isResultDependent (implicit ctx : Context ): Boolean = true
3009
3009
def isParamDependent (implicit ctx : Context ): Boolean = true
3010
3010
3011
- def newParamRef (n : Int ) = new TypeParamRef (this , n) {}
3011
+ def newParamRef (n : Int ): TypeParamRef = new TypeParamRefImpl (this , n)
3012
3012
3013
3013
lazy val typeParams : List [LambdaParam ] =
3014
3014
paramNames.indices.toList.map(new LambdaParam (this , _))
@@ -3285,6 +3285,8 @@ object Types {
3285
3285
def copyBoundType (bt : BT ) = bt.paramRefs(paramNum)
3286
3286
}
3287
3287
3288
+ private final class TermParamRefImpl (binder : TermLambda , paramNum : Int ) extends TermParamRef (binder, paramNum)
3289
+
3288
3290
/** Only created in `binder.paramRefs`. Use `binder.paramRefs(paramNum)` to
3289
3291
* refer to `TypeParamRef(binder, paramNum)`.
3290
3292
*/
@@ -3305,6 +3307,8 @@ object Types {
3305
3307
}
3306
3308
}
3307
3309
3310
+ private final class TypeParamRefImpl (binder : TypeLambda , paramNum : Int ) extends TypeParamRef (binder, paramNum)
3311
+
3308
3312
/** a self-reference to an enclosing recursive type. The only creation method is
3309
3313
* `binder.recThis`, returning `RecThis(binder)`.
3310
3314
*/
@@ -3331,6 +3335,8 @@ object Types {
3331
3335
}
3332
3336
}
3333
3337
3338
+ private final class RecThisImpl (binder : RecType ) extends RecThis (binder)
3339
+
3334
3340
// ----- Skolem types -----------------------------------------------
3335
3341
3336
3342
/** A skolem type reference with underlying type `binder`. */
0 commit comments