Skip to content

Commit be8c931

Browse files
committed
Revert "some vars need unspecified isolation for initializing exprs"
This reverts commit 386940c.
1 parent bdce80f commit be8c931

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

lib/AST/Decl.cpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8785,23 +8785,10 @@ ActorIsolation swift::getActorIsolationOfContext(DeclContext *dc) {
87858785
if (auto *vd = dyn_cast_or_null<ValueDecl>(dc->getAsDecl()))
87868786
return getActorIsolation(vd);
87878787

8788-
// In the context of the initializing or default-value expression of a
8789-
// stored property, the isolation varies between global and type members:
8790-
// - For a static stored property, the isolation matches the VarDecl.
8791-
// - For a field of a nominal type, the expression is not isolated.
8792-
// Without this distinction, a nominal can have non-async initializers
8793-
// with various kinds of isolation, so an impossible constraint can be
8794-
// created. See SE-0327 for details.
87958788
if (auto *init = dyn_cast<PatternBindingInitializer>(dc)) {
8796-
if (auto *var =
8797-
init->getBinding()->getAnchoringVarDecl(init->getBindingIndex())) {
8798-
8799-
if (var->isInstanceMember() &&
8800-
!var->getAttrs().hasAttribute<LazyAttr>())
8801-
return ActorIsolation::forUnspecified();
8802-
8789+
if (auto *var = init->getBinding()->getAnchoringVarDecl(
8790+
init->getBindingIndex()))
88038791
return getActorIsolation(var);
8804-
}
88058792
}
88068793

88078794
if (auto *closure = dyn_cast<AbstractClosureExpr>(dc)) {

test/Concurrency/property_initializers.swift

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)