@@ -2355,7 +2355,7 @@ object Types {
23552355 private [this ] var myRecThis : RecThis = null
23562356
23572357 def recThis : RecThis = {
2358- if (myRecThis == null ) myRecThis = new RecThis (this ) {}
2358+ if (myRecThis == null ) myRecThis = new RecThisImpl (this )
23592359 myRecThis
23602360 }
23612361
@@ -2849,7 +2849,7 @@ object Types {
28492849 */
28502850 def isParamDependent (implicit ctx : Context ): Boolean = paramDependencyStatus == TrueDeps
28512851
2852- def newParamRef (n : Int ) = new TermParamRef (this , n) {}
2852+ def newParamRef (n : Int ): TermParamRef = new TermParamRefImpl (this , n)
28532853
28542854 /** The least supertype of `resultType` that does not contain parameter dependencies */
28552855 def nonDependentResultApprox (implicit ctx : Context ): Type =
@@ -3008,7 +3008,7 @@ object Types {
30083008 def isResultDependent (implicit ctx : Context ): Boolean = true
30093009 def isParamDependent (implicit ctx : Context ): Boolean = true
30103010
3011- def newParamRef (n : Int ) = new TypeParamRef (this , n) {}
3011+ def newParamRef (n : Int ): TypeParamRef = new TypeParamRefImpl (this , n)
30123012
30133013 lazy val typeParams : List [LambdaParam ] =
30143014 paramNames.indices.toList.map(new LambdaParam (this , _))
@@ -3285,6 +3285,8 @@ object Types {
32853285 def copyBoundType (bt : BT ) = bt.paramRefs(paramNum)
32863286 }
32873287
3288+ private final class TermParamRefImpl (binder : TermLambda , paramNum : Int ) extends TermParamRef (binder, paramNum)
3289+
32883290 /** Only created in `binder.paramRefs`. Use `binder.paramRefs(paramNum)` to
32893291 * refer to `TypeParamRef(binder, paramNum)`.
32903292 */
@@ -3305,6 +3307,8 @@ object Types {
33053307 }
33063308 }
33073309
3310+ private final class TypeParamRefImpl (binder : TypeLambda , paramNum : Int ) extends TypeParamRef (binder, paramNum)
3311+
33083312 /** a self-reference to an enclosing recursive type. The only creation method is
33093313 * `binder.recThis`, returning `RecThis(binder)`.
33103314 */
@@ -3331,6 +3335,8 @@ object Types {
33313335 }
33323336 }
33333337
3338+ private final class RecThisImpl (binder : RecType ) extends RecThis (binder)
3339+
33343340 // ----- Skolem types -----------------------------------------------
33353341
33363342 /** A skolem type reference with underlying type `binder`. */
0 commit comments