mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
This commit is contained in:
@@ -798,15 +798,8 @@ AbstractionPattern::getFunctionParamType(unsigned index) const {
|
||||
return AbstractionPattern::getOpaque();
|
||||
auto fnType = cast<AnyFunctionType>(getType());
|
||||
auto param = fnType.getParams()[index];
|
||||
auto paramType = param.getType();
|
||||
// FIXME: Extract this into a utility method
|
||||
if (param.isVariadic()) {
|
||||
auto &ctx = paramType->getASTContext();
|
||||
paramType = CanType(BoundGenericType::get(ctx.getArrayDecl(),
|
||||
Type(), {paramType}));
|
||||
}
|
||||
return AbstractionPattern(getGenericSignatureForFunctionComponent(),
|
||||
paramType);
|
||||
param.getParameterType());
|
||||
}
|
||||
default:
|
||||
// FIXME: Re-implement this
|
||||
|
||||
Reference in New Issue
Block a user