@@ -1348,7 +1348,7 @@ object Types {
13481348 case tp : AndType =>
13491349 tp.derivedAndType(tp.tp1.widenUnionWithoutNull, tp.tp2.widenUnionWithoutNull)
13501350 case tp : RefinedType =>
1351- tp.derivedRefinedType(tp. parent.widenUnion, tp.refinedName, tp.refinedInfo )
1351+ tp.derivedRefinedType(parent = tp.parent.widenUnion )
13521352 case tp : RecType =>
13531353 tp.rebind(tp.parent.widenUnion)
13541354 case tp : HKTypeLambda =>
@@ -3195,7 +3195,9 @@ object Types {
31953195
31963196 def checkInst (using Context ): this .type = this // debug hook
31973197
3198- def derivedRefinedType (parent : Type , refinedName : Name , refinedInfo : Type )(using Context ): Type =
3198+ final def derivedRefinedType
3199+ (parent : Type = this .parent, refinedName : Name = this .refinedName, refinedInfo : Type = this .refinedInfo)
3200+ (using Context ): Type =
31993201 if ((parent eq this .parent) && (refinedName eq this .refinedName) && (refinedInfo eq this .refinedInfo)) this
32003202 else RefinedType (parent, refinedName, refinedInfo)
32013203
@@ -4101,7 +4103,7 @@ object Types {
41014103 case tp @ AppliedType (tycon, args) if defn.isFunctionNType(tp) =>
41024104 wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addInto(args.last)))
41034105 case tp @ defn.RefinedFunctionOf (rinfo) =>
4104- wrapConvertible(tp.derivedRefinedType(tp.parent, tp.refinedName, addInto(rinfo)))
4106+ wrapConvertible(tp.derivedRefinedType(refinedInfo = addInto(rinfo)))
41054107 case tp : MethodOrPoly =>
41064108 tp.derivedLambdaType(resType = addInto(tp.resType))
41074109 case ExprType (resType) =>
@@ -5612,8 +5614,8 @@ object Types {
56125614 else hi
56135615 case (arg, _) => arg
56145616 tp.derivedAppliedType(tycon, args1)
5615- case tp @ RefinedType (parent, name, info) =>
5616- tp.derivedRefinedType(approxWildcardArgs(parent), name, info )
5617+ case tp : RefinedType =>
5618+ tp.derivedRefinedType(approxWildcardArgs(tp. parent))
56175619 case _ =>
56185620 tp
56195621 approxWildcardArgs(tp)
0 commit comments