Skip to content

Commit 74763e1

Browse files
slavapestovDavide Italiano
authored andcommitted
SIL: Simplify AbstractionPattern::getFunctionParamType()
Use the new AnyFunctionType::Param::getParameterType() method John added, instead of encoding knowledge of varargs directly here. Also don't wrap the result in an InOutType since for now, clients only use this for Objective-C methods which don't have inout parameters, and upcoming usages need the unwrapped type anyway.
1 parent f29a061 commit 74763e1

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/SIL/AbstractionPattern.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -798,15 +798,8 @@ AbstractionPattern::getFunctionParamType(unsigned index) const {
798798
return AbstractionPattern::getOpaque();
799799
auto fnType = cast<AnyFunctionType>(getType());
800800
auto param = fnType.getParams()[index];
801-
auto paramType = param.getType();
802-
// FIXME: Extract this into a utility method
803-
if (param.isVariadic()) {
804-
auto &ctx = paramType->getASTContext();
805-
paramType = CanType(BoundGenericType::get(ctx.getArrayDecl(),
806-
Type(), {paramType}));
807-
}
808801
return AbstractionPattern(getGenericSignatureForFunctionComponent(),
809-
paramType);
802+
param.getParameterType());
810803
}
811804
default:
812805
// FIXME: Re-implement this

0 commit comments

Comments
 (0)