@@ -1525,7 +1525,7 @@ synthesizeSetterBody(AccessorDecl *setter, ASTContext &ctx) {
1525
1525
return synthesizePropertyWrapperSetterBody (setter, ctx);
1526
1526
}
1527
1527
1528
- // Synthesize a getter for the storage wrapper property of a property
1528
+ // Synthesize a setter for the storage wrapper property of a property
1529
1529
// with an attached wrapper.
1530
1530
if (auto original = var->getOriginalWrappedProperty (
1531
1531
PropertyWrapperSynthesizedPropertyKind::StorageWrapper)) {
@@ -1571,10 +1571,16 @@ synthesizeCoroutineAccessorBody(AccessorDecl *accessor, ASTContext &ctx) {
1571
1571
: TargetImpl::Implementation);
1572
1572
1573
1573
// If this is a variable with an attached property wrapper, then
1574
- // the accessors need to yield the wrapped value.
1575
- if (isa<VarDecl>(storage) &&
1576
- cast<VarDecl>(storage)->hasAttachedPropertyWrapper ()) {
1577
- target = TargetImpl::Wrapper;
1574
+ // the accessors need to yield the wrappedValue or projectedValue.
1575
+ if (auto var = dyn_cast<VarDecl>(storage)) {
1576
+ if (var->hasAttachedPropertyWrapper ()) {
1577
+ target = TargetImpl::Wrapper;
1578
+ }
1579
+
1580
+ if (var->getOriginalWrappedProperty (
1581
+ PropertyWrapperSynthesizedPropertyKind::StorageWrapper)) {
1582
+ target = TargetImpl::WrapperStorage;
1583
+ }
1578
1584
}
1579
1585
1580
1586
SourceLoc loc = storage->getLoc ();
0 commit comments