@@ -1328,7 +1328,7 @@ object Types {
13281328 case tp : AndType =>
13291329 tp.derivedAndType(tp.tp1.widenUnionWithoutNull, tp.tp2.widenUnionWithoutNull)
13301330 case tp : RefinedType =>
1331- tp.derivedRefinedType(tp. parent.widenUnion, tp.refinedName, tp.refinedInfo )
1331+ tp.derivedRefinedType(parent = tp.parent.widenUnion )
13321332 case tp : RecType =>
13331333 tp.rebind(tp.parent.widenUnion)
13341334 case tp : HKTypeLambda =>
@@ -3152,7 +3152,9 @@ object Types {
31523152
31533153 def checkInst (using Context ): this .type = this // debug hook
31543154
3155- def derivedRefinedType (parent : Type , refinedName : Name , refinedInfo : Type )(using Context ): Type =
3155+ final def derivedRefinedType
3156+ (parent : Type = this .parent, refinedName : Name = this .refinedName, refinedInfo : Type = this .refinedInfo)
3157+ (using Context ): Type =
31563158 if ((parent eq this .parent) && (refinedName eq this .refinedName) && (refinedInfo eq this .refinedInfo)) this
31573159 else RefinedType (parent, refinedName, refinedInfo)
31583160
@@ -4056,7 +4058,7 @@ object Types {
40564058 case tp @ AppliedType (tycon, args) if defn.isFunctionNType(tp) =>
40574059 wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addInto(args.last)))
40584060 case tp @ defn.RefinedFunctionOf (rinfo) =>
4059- wrapConvertible(tp.derivedRefinedType(tp.parent, tp.refinedName, addInto(rinfo)))
4061+ wrapConvertible(tp.derivedRefinedType(refinedInfo = addInto(rinfo)))
40604062 case tp : MethodOrPoly =>
40614063 tp.derivedLambdaType(resType = addInto(tp.resType))
40624064 case ExprType (resType) =>
0 commit comments