Skip to content

Commit 0e561ce

Browse files
committed
[PropertyWrappers] When performing the lvalue computation for property wrappers, skip if the accessor is a coroutine
1 parent 636dfd6 commit 0e561ce

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,11 +738,13 @@ static Expr *buildStorageReference(AccessorDecl *accessor,
738738

739739
// If we're acessing a property wrapper, determine if the
740740
// intermediate access requires an lvalue.
741-
if (auto var = dyn_cast<VarDecl>(accessor->getStorage())) {
742-
if (auto mut = var->getPropertyWrapperMutability()) {
743-
isMemberLValue = mut->Getter == PropertyWrapperMutability::Mutating;
744-
if (isLValue)
745-
isMemberLValue |= mut->Setter == PropertyWrapperMutability::Mutating;
741+
if (!accessor->isCoroutine()) {
742+
if (auto var = dyn_cast<VarDecl>(accessor->getStorage())) {
743+
if (auto mut = var->getPropertyWrapperMutability()) {
744+
isMemberLValue = mut->Getter == PropertyWrapperMutability::Mutating;
745+
if (isLValue)
746+
isMemberLValue |= mut->Setter == PropertyWrapperMutability::Mutating;
747+
}
746748
}
747749
}
748750

0 commit comments

Comments
 (0)