@@ -3787,13 +3787,22 @@ object Types {
3787
3787
case ExprType (resType) => ExprType (addAnnotation(resType, cls))
3788
3788
case _ => AnnotatedType (tp, Annotation (cls))
3789
3789
3790
+ def wrapConvertible (tp : Type ) =
3791
+ AppliedType (defn.ConvertibleToType .typeRef, tp :: Nil )
3792
+
3790
3793
def addConvertibleTo (tp : Type ): Type = tp match
3794
+ case tp @ AppliedType (tycon, args) if tycon.typeSymbol == defn.RepeatedParamClass =>
3795
+ tp.derivedAppliedType(tycon, addConvertibleTo(args.head) :: Nil )
3796
+ case tp @ AppliedType (tycon, args) if defn.isFunctionType(tp) =>
3797
+ wrapConvertible(tp.derivedAppliedType(tycon, args.init :+ addConvertibleTo(args.last)))
3798
+ case tp @ RefinedType (parent, rname, rinfo) if defn.isFunctionType(tp) =>
3799
+ wrapConvertible(tp.derivedRefinedType(parent, rname, addConvertibleTo(rinfo)))
3800
+ case tp : MethodType =>
3801
+ tp.derivedLambdaType(resType = addConvertibleTo(tp.resType))
3791
3802
case ExprType (resType) =>
3792
3803
ExprType (addConvertibleTo(resType))
3793
- case tp @ AppliedType (tycon, arg :: Nil ) if tycon.typeSymbol == defn.RepeatedParamClass =>
3794
- tp.derivedAppliedType(tycon, addConvertibleTo(arg) :: Nil )
3795
3804
case _ =>
3796
- AppliedType (defn. ConvertibleToType .typeRef, tp :: Nil )
3805
+ wrapConvertible(tp )
3797
3806
3798
3807
def paramInfo (param : Symbol ) =
3799
3808
var paramType = param.info.annotatedToRepeated
0 commit comments