@@ -4175,24 +4175,28 @@ object Types extends TypeUtils {
4175
4175
* - wrap types of parameters that have an @allowConversions annotation with Into[_]
4176
4176
*/
4177
4177
def fromSymbols (params : List [Symbol ], resultType : Type )(using Context ): MethodType =
4178
+ apply(params.map(_.name.asTermName))(
4179
+ tl => params.map(p => tl.integrate(params, adaptParamInfo(p))),
4180
+ tl => tl.integrate(params, resultType))
4181
+
4182
+ /** Adapt info of parameter symbol to be integhrated into corresponding MethodType
4183
+ * using the scheme described in `fromSymbols`.
4184
+ */
4185
+ def adaptParamInfo (param : Symbol , pinfo : Type )(using Context ): Type =
4178
4186
def addAnnotation (tp : Type , cls : ClassSymbol , param : Symbol ): Type = tp match
4179
4187
case ExprType (resType) => ExprType (addAnnotation(resType, cls, param))
4180
4188
case _ => AnnotatedType (tp, Annotation (cls, param.span))
4181
-
4182
- def paramInfo (param : Symbol ) =
4183
- var paramType = param.info
4184
- .annotatedToRepeated
4185
- .mapIntoAnnot(defn.IntoAnnot , defn.IntoParamAnnot )
4186
- if param.is(Inline ) then
4187
- paramType = addAnnotation(paramType, defn.InlineParamAnnot , param)
4188
- if param.is(Erased ) then
4189
- paramType = addAnnotation(paramType, defn.ErasedParamAnnot , param)
4190
- paramType
4191
-
4192
- apply(params.map(_.name.asTermName))(
4193
- tl => params.map(p => tl.integrate(params, paramInfo(p))),
4194
- tl => tl.integrate(params, resultType))
4195
- end fromSymbols
4189
+ var paramType = pinfo
4190
+ .annotatedToRepeated
4191
+ .mapIntoAnnot(defn.IntoAnnot , defn.IntoParamAnnot )
4192
+ if param.is(Inline ) then
4193
+ paramType = addAnnotation(paramType, defn.InlineParamAnnot , param)
4194
+ if param.is(Erased ) then
4195
+ paramType = addAnnotation(paramType, defn.ErasedParamAnnot , param)
4196
+ paramType
4197
+
4198
+ def adaptParamInfo (param : Symbol )(using Context ): Type =
4199
+ adaptParamInfo(param, param.info)
4196
4200
4197
4201
def apply (paramNames : List [TermName ])(paramInfosExp : MethodType => List [Type ], resultTypeExp : MethodType => Type )(using Context ): MethodType =
4198
4202
checkValid(unique(new CachedMethodType (paramNames)(paramInfosExp, resultTypeExp, self)))
0 commit comments