mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[cxx-interop] Import const-qualified indirect fields with private setters (#83219)
We already make imported computed properties' setters private in VisitFieldDecl(), but not in VisitIndirectFieldDecl(), which handles things like the members of an anonymous union in another struct.
This commit is contained in:
@@ -3371,6 +3371,12 @@ namespace {
|
||||
result->setInterfaceType(type);
|
||||
result->setIsObjC(false);
|
||||
result->setIsDynamic(false);
|
||||
if (decl->getType().isConstQualified()) {
|
||||
// Note that in C++ there are ways to change the values of const
|
||||
// members, so we don't use WriteImplKind::Immutable storage.
|
||||
assert(result->supportsMutation());
|
||||
result->overwriteSetterAccess(AccessLevel::Private);
|
||||
}
|
||||
Impl.recordImplicitUnwrapForDecl(result,
|
||||
importedType.isImplicitlyUnwrapped());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user