Merge pull request #78021 from jckarter/addressable-params-2

Add an `@_addressableSelf` attribute to mark the self param of methods as addressable.
This commit is contained in:
Joe Groff
2024-12-09 08:42:49 -08:00
committed by GitHub
11 changed files with 60 additions and 3 deletions

View File

@@ -4057,6 +4057,10 @@ AnyFunctionType::Param swift::computeSelfParam(AbstractFunctionDecl *AFD,
// The default flagless state.
break;
}
if (AFD->getAttrs().hasAttribute<AddressableSelfAttr>()) {
flags = flags.withAddressable(true);
}
return AnyFunctionType::Param(selfTy, Identifier(), flags);
}