Skip to content

Commit a1541a1

Browse files
committed
[TBDGen] Only emit backing initializer for non-resilient properties.
1 parent 4ba1833 commit a1541a1

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

lib/TBDGen/TBDGen.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,14 @@ void TBDGenVisitor::visitVarDecl(VarDecl *VD) {
311311
addSymbol(SILDeclRef(VD, SILDeclRef::Kind::GlobalAccessor));
312312
}
313313

314-
}
315-
316-
// Wrapped non-static member properties may have a backing initializer.
317-
if (auto wrapperInfo = VD->getPropertyWrapperBackingPropertyInfo()) {
318-
if (wrapperInfo.initializeFromOriginal && !VD->isStatic()) {
319-
addSymbol(
320-
SILDeclRef(VD, SILDeclRef::Kind::PropertyWrapperBackingInitializer));
314+
// Wrapped non-static member properties may have a backing initializer.
315+
if (auto wrapperInfo = VD->getPropertyWrapperBackingPropertyInfo()) {
316+
if (wrapperInfo.initializeFromOriginal && !VD->isStatic()) {
317+
addSymbol(
318+
SILDeclRef(VD, SILDeclRef::Kind::PropertyWrapperBackingInitializer));
319+
}
321320
}
322-
};
321+
}
323322

324323
visitAbstractStorageDecl(VD);
325324
}

test/TBD/property_wrapper.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=all %s
2+
// RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=all -enable-library-evolution %s
23

34
@propertyWrapper
45
public struct Wrapper<Value> {

0 commit comments

Comments
 (0)