@@ -1360,7 +1360,7 @@ object Types {
13601360 case tp : AndType =>
13611361 tp.derivedAndType(tp.tp1.widenUnionWithoutNull, tp.tp2.widenUnionWithoutNull)
13621362 case tp : RefinedType =>
1363- tp.derivedRefinedType(tp. parent.widenUnion, tp.refinedName, tp.refinedInfo )
1363+ tp.derivedRefinedType(parent = tp.parent.widenUnion )
13641364 case tp : RecType =>
13651365 tp.rebind(tp.parent.widenUnion)
13661366 case tp : HKTypeLambda =>
@@ -3226,7 +3226,9 @@ object Types {
32263226
32273227 def checkInst (using Context ): this .type = this // debug hook
32283228
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 =
32303232 if ((parent eq this .parent) && (refinedName eq this .refinedName) && (refinedInfo eq this .refinedInfo)) this
32313233 else RefinedType (parent, refinedName, refinedInfo)
32323234
@@ -4130,7 +4132,7 @@ object Types {
41304132 case tp @ AppliedType (tycon, args) if defn.isFunctionNType(tp) =>
41314133 wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addInto(args.last)))
41324134 case tp @ defn.RefinedFunctionOf (rinfo) =>
4133- wrapConvertible(tp.derivedRefinedType(tp.parent, tp.refinedName, addInto(rinfo)))
4135+ wrapConvertible(tp.derivedRefinedType(refinedInfo = addInto(rinfo)))
41344136 case tp : MethodOrPoly =>
41354137 tp.derivedLambdaType(resType = addInto(tp.resType))
41364138 case ExprType (resType) =>
@@ -5631,8 +5633,8 @@ object Types {
56315633 else hi
56325634 case (arg, _) => arg
56335635 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))
56365638 case _ =>
56375639 tp
56385640 approxWildcardArgs(tp)
0 commit comments