Skip to content

Commit 1264c56

Browse files
committed
Revert "[Typechecker] Don't use PropertyWrapperMutability for isSelfLValue check"
This reverts commit 48a5e86338c099d86f2d9f77e9ba14b4a37b3fe9.
1 parent 33be7a2 commit 1264c56

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,14 @@ static Expr *buildStorageReference(AccessorDecl *accessor,
765765
if (isMemberLValue)
766766
isSelfLValue |= storage->isSetterMutating();
767767

768+
// If we're accessing a property wrapper, determine if
769+
// the self requires an lvalue.
770+
if (auto mut = propertyWrapperMutability(storage)) {
771+
isSelfLValue = mut->first;
772+
if (isMemberLValue)
773+
isSelfLValue |= mut->second;
774+
}
775+
768776
Expr *selfDRE =
769777
buildSelfReference(selfDecl, selfAccessKind, isSelfLValue,
770778
ctx);

0 commit comments

Comments
 (0)