@@ -1343,7 +1343,7 @@ object Types {
1343
1343
case tp : AndType =>
1344
1344
tp.derivedAndType(tp.tp1.widenUnionWithoutNull, tp.tp2.widenUnionWithoutNull)
1345
1345
case tp : RefinedType =>
1346
- tp.derivedRefinedType(tp. parent.widenUnion, tp.refinedName, tp.refinedInfo )
1346
+ tp.derivedRefinedType(parent = tp.parent.widenUnion )
1347
1347
case tp : RecType =>
1348
1348
tp.rebind(tp.parent.widenUnion)
1349
1349
case tp : HKTypeLambda =>
@@ -3192,7 +3192,9 @@ object Types {
3192
3192
3193
3193
def checkInst (using Context ): this .type = this // debug hook
3194
3194
3195
- def derivedRefinedType (parent : Type , refinedName : Name , refinedInfo : Type )(using Context ): Type =
3195
+ final def derivedRefinedType
3196
+ (parent : Type = this .parent, refinedName : Name = this .refinedName, refinedInfo : Type = this .refinedInfo)
3197
+ (using Context ): Type =
3196
3198
if ((parent eq this .parent) && (refinedName eq this .refinedName) && (refinedInfo eq this .refinedInfo)) this
3197
3199
else RefinedType (parent, refinedName, refinedInfo)
3198
3200
@@ -4098,7 +4100,7 @@ object Types {
4098
4100
case tp @ AppliedType (tycon, args) if defn.isFunctionNType(tp) =>
4099
4101
wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addInto(args.last)))
4100
4102
case tp @ defn.RefinedFunctionOf (rinfo) =>
4101
- wrapConvertible(tp.derivedRefinedType(tp.parent, tp.refinedName, addInto(rinfo)))
4103
+ wrapConvertible(tp.derivedRefinedType(refinedInfo = addInto(rinfo)))
4102
4104
case tp : MethodOrPoly =>
4103
4105
tp.derivedLambdaType(resType = addInto(tp.resType))
4104
4106
case ExprType (resType) =>
@@ -5609,8 +5611,8 @@ object Types {
5609
5611
else hi
5610
5612
case (arg, _) => arg
5611
5613
tp.derivedAppliedType(tycon, args1)
5612
- case tp @ RefinedType (parent, name, info) =>
5613
- tp.derivedRefinedType(approxWildcardArgs(parent), name, info )
5614
+ case tp : RefinedType =>
5615
+ tp.derivedRefinedType(approxWildcardArgs(tp. parent))
5614
5616
case _ =>
5615
5617
tp
5616
5618
approxWildcardArgs(tp)
0 commit comments