mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Remove a few usages of TypeBase::getInOutObjectType()
This commit is contained in:
@@ -1982,12 +1982,7 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type,
|
||||
if (curryLevels == 0) {
|
||||
// In an initializer, ignore optionality.
|
||||
if (isInitializer) {
|
||||
if (auto inOutTy = type->getAs<InOutType>()) {
|
||||
if (auto objectType =
|
||||
inOutTy->getObjectType()->getOptionalObjectType()) {
|
||||
type = InOutType::get(objectType);
|
||||
}
|
||||
} else if (auto objectType = type->getOptionalObjectType()) {
|
||||
if (auto objectType = type->getOptionalObjectType()) {
|
||||
type = objectType;
|
||||
}
|
||||
}
|
||||
@@ -1998,7 +1993,7 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type,
|
||||
auto funcTy = type->castTo<AnyFunctionType>();
|
||||
SmallVector<AnyFunctionType::Param, 4> newParams;
|
||||
for (const auto ¶m : funcTy->getParams()) {
|
||||
auto newParamType = mapSignatureParamType(ctx, param.getType());
|
||||
auto newParamType = mapSignatureParamType(ctx, param.getPlainType());
|
||||
ParameterTypeFlags newFlags = param.getParameterFlags().withEscaping(false);
|
||||
|
||||
// For the 'self' of a method, strip off 'inout'.
|
||||
@@ -2006,8 +2001,7 @@ static Type mapSignatureFunctionType(ASTContext &ctx, Type type,
|
||||
newFlags = newFlags.withInOut(false);
|
||||
}
|
||||
|
||||
AnyFunctionType::Param newParam(newParamType->getInOutObjectType(),
|
||||
param.getLabel(), newFlags);
|
||||
AnyFunctionType::Param newParam(newParamType, param.getLabel(), newFlags);
|
||||
newParams.push_back(newParam);
|
||||
}
|
||||
|
||||
@@ -4721,7 +4715,7 @@ ParamDecl::ParamDecl(ParamDecl *PD, bool withTypes)
|
||||
typeLoc.setType(Type());
|
||||
|
||||
if (withTypes && PD->hasInterfaceType())
|
||||
setInterfaceType(PD->getInterfaceType()->getInOutObjectType());
|
||||
setInterfaceType(PD->getInterfaceType());
|
||||
|
||||
// FIXME: We should clone the entire attribute list.
|
||||
if (PD->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>())
|
||||
|
||||
Reference in New Issue
Block a user