File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 21
21
#include " swift/AST/ASTVisitor.h"
22
22
#include " swift/AST/Module.h"
23
23
#include " swift/AST/ParameterList.h"
24
+ #include " swift/AST/PropertyWrappers.h"
24
25
#include " swift/Basic/LLVM.h"
25
26
#include " swift/IRGen/Linking.h"
26
27
#include " swift/SIL/FormalLinkage.h"
@@ -309,8 +310,17 @@ void TBDGenVisitor::visitVarDecl(VarDecl *VD) {
309
310
if (VD->isLazilyInitializedGlobal ())
310
311
addSymbol (SILDeclRef (VD, SILDeclRef::Kind::GlobalAccessor));
311
312
}
313
+
312
314
}
313
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));
321
+ }
322
+ };
323
+
314
324
visitAbstractStorageDecl (VD);
315
325
}
316
326
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-ir -o/dev/null -parse-as-library -module-name test -validate-tbd-against-ir=all %s
2
+
3
+ @propertyWrapper
4
+ public struct Wrapper < Value> {
5
+ public var wrappedValue : Value
6
+
7
+ public init ( wrappedValue: Value ) {
8
+ self . wrappedValue = wrappedValue
9
+ }
10
+ }
11
+
12
+ public struct UseWrapper {
13
+ @Wrapper public var string = " hello "
14
+ }
15
+
You can’t perform that action at this time.
0 commit comments