@@ -1360,7 +1360,7 @@ object Types {
1360
1360
case tp : AndType =>
1361
1361
tp.derivedAndType(tp.tp1.widenUnionWithoutNull, tp.tp2.widenUnionWithoutNull)
1362
1362
case tp : RefinedType =>
1363
- tp.derivedRefinedType(tp. parent.widenUnion, tp.refinedName, tp.refinedInfo )
1363
+ tp.derivedRefinedType(parent = tp.parent.widenUnion )
1364
1364
case tp : RecType =>
1365
1365
tp.rebind(tp.parent.widenUnion)
1366
1366
case tp : HKTypeLambda =>
@@ -3226,7 +3226,9 @@ object Types {
3226
3226
3227
3227
def checkInst (using Context ): this .type = this // debug hook
3228
3228
3229
- def derivedRefinedType (parent : Type , refinedName : Name , refinedInfo : Type )(using Context ): Type =
3229
+ final def derivedRefinedType
3230
+ (parent : Type = this .parent, refinedName : Name = this .refinedName, refinedInfo : Type = this .refinedInfo)
3231
+ (using Context ): Type =
3230
3232
if ((parent eq this .parent) && (refinedName eq this .refinedName) && (refinedInfo eq this .refinedInfo)) this
3231
3233
else RefinedType (parent, refinedName, refinedInfo)
3232
3234
@@ -4130,7 +4132,7 @@ object Types {
4130
4132
case tp @ AppliedType (tycon, args) if defn.isFunctionNType(tp) =>
4131
4133
wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addInto(args.last)))
4132
4134
case tp @ defn.RefinedFunctionOf (rinfo) =>
4133
- wrapConvertible(tp.derivedRefinedType(tp.parent, tp.refinedName, addInto(rinfo)))
4135
+ wrapConvertible(tp.derivedRefinedType(refinedInfo = addInto(rinfo)))
4134
4136
case tp : MethodOrPoly =>
4135
4137
tp.derivedLambdaType(resType = addInto(tp.resType))
4136
4138
case ExprType (resType) =>
@@ -5631,8 +5633,8 @@ object Types {
5631
5633
else hi
5632
5634
case (arg, _) => arg
5633
5635
tp.derivedAppliedType(tycon, args1)
5634
- case tp @ RefinedType (parent, name, info) =>
5635
- tp.derivedRefinedType(approxWildcardArgs(parent), name, info )
5636
+ case tp : RefinedType =>
5637
+ tp.derivedRefinedType(approxWildcardArgs(tp. parent))
5636
5638
case _ =>
5637
5639
tp
5638
5640
approxWildcardArgs(tp)
0 commit comments