Skip to content

Commit 6549a0d

Browse files
committed
Don't emit the property wrapper backing initializer publicly for resilient properties
1 parent 2a74d0b commit 6549a0d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/SIL/SILDeclRef.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,13 @@ SILLinkage SILDeclRef::getLinkage(ForDefinition_t forDefinition) const {
313313
limit = Limit::NeverPublic;
314314
}
315315

316+
// The property wrapper backing initializer is never public for resilient
317+
// properties.
318+
if (kind == SILDeclRef::Kind::PropertyWrapperBackingInitializer) {
319+
if (cast<VarDecl>(d)->isResilient())
320+
limit = Limit::NeverPublic;
321+
}
322+
316323
// Stored property initializers get the linkage of their containing type.
317324
if (isStoredPropertyInitializer()) {
318325
// Three cases:

0 commit comments

Comments
 (0)