Skip to content

Commit 68b53e2

Browse files
committed
Revert "some vars need unspecified isolation for initializing exprs"
This reverts commit 386940c.
1 parent 46c2e8d commit 68b53e2

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
@@ -8667,23 +8667,10 @@ ActorIsolation swift::getActorIsolationOfContext(DeclContext *dc) {
86678667
if (auto *vd = dyn_cast_or_null<ValueDecl>(dc->getAsDecl()))
86688668
return getActorIsolation(vd);
86698669

8670-
// In the context of the initializing or default-value expression of a
8671-
// stored property, the isolation varies between global and type members:
8672-
// - For a static stored property, the isolation matches the VarDecl.
8673-
// - For a field of a nominal type, the expression is not isolated.
8674-
// Without this distinction, a nominal can have non-async initializers
8675-
// with various kinds of isolation, so an impossible constraint can be
8676-
// created. See SE-0327 for details.
86778670
if (auto *init = dyn_cast<PatternBindingInitializer>(dc)) {
8678-
if (auto *var =
8679-
init->getBinding()->getAnchoringVarDecl(init->getBindingIndex())) {
8680-
8681-
if (var->isInstanceMember() &&
8682-
!var->getAttrs().hasAttribute<LazyAttr>())
8683-
return ActorIsolation::forUnspecified();
8684-
8671+
if (auto *var = init->getBinding()->getAnchoringVarDecl(
8672+
init->getBindingIndex()))
86858673
return getActorIsolation(var);
8686-
}
86878674
}
86888675

86898676
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)