Skip to content

Commit 1a6b333

Browse files
committed
[Sema] Propagate nonisolated attribute from wrapped variable to the synthesized projectedValue variable
1 parent a620288 commit 1a6b333

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/Sema/TypeCheckStorage.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2685,6 +2685,13 @@ static VarDecl *synthesizePropertyWrapperProjectionVar(
26852685
var->getAttrs().add(
26862686
new (ctx) ProjectedValuePropertyAttr(name, SourceLoc(), SourceRange(),
26872687
/*Implicit=*/true));
2688+
2689+
// If the wrapped property has a nonisolated attribute, propagate it to
2690+
// the synthesized projectedValue as well.
2691+
if (var->getAttrs().getAttribute<NonisolatedAttr>()) {
2692+
property->getAttrs().add(new (ctx) NonisolatedAttr(/*Implicit=*/true));
2693+
}
2694+
26882695
return property;
26892696
}
26902697

0 commit comments

Comments
 (0)