Skip to content

Commit 9440fb6

Browse files
committed
[CS] Use getPlainType instead of getParameterType
1 parent 7f1f092 commit 9440fb6

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3778,16 +3778,7 @@ static bool diagnoseContextualFunctionCallGenericAmbiguity(
37783778
TypeVariableType *typeVar) {
37793779
auto argParamMatch = argMatching->second.parameterBindings[argIdx];
37803780
auto param = applyFnType->getParams()[argParamMatch.front()];
3781-
if (param.isVariadic()) {
3782-
auto paramType = param.getParameterType();
3783-
// Variadic parameter is constructed as an ArraySliceType(which is
3784-
// just sugared type for a bound generic) with the closure type as
3785-
// element.
3786-
auto baseType = paramType->getDesugaredType()->castTo<BoundGenericType>();
3787-
auto paramFnType = baseType->getGenericArgs()[0]->castTo<FunctionType>();
3788-
return cs.typeVarOccursInType(typeVar, paramFnType->getResult());
3789-
}
3790-
auto paramFnType = param.getParameterType()->castTo<FunctionType>();
3781+
auto paramFnType = param.getPlainType()->castTo<FunctionType>();
37913782
return cs.typeVarOccursInType(typeVar, paramFnType->getResult());
37923783
};
37933784

0 commit comments

Comments
 (0)