Skip to content

Commit b4fa392

Browse files
committed
nonisolated is permitted on a let nowadays
1 parent b09c55a commit b4fa392

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5444,14 +5444,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
54445444
// that do not have storage.
54455445
auto dc = D->getDeclContext();
54465446
if (auto var = dyn_cast<VarDecl>(D)) {
5447-
// 'nonisolated' is meaningless on a `let`.
5448-
if (var->isLet()) {
5449-
diagnoseAndRemoveAttr(attr, diag::nonisolated_let);
5450-
return;
5451-
}
5452-
5453-
// 'nonisolated' can not be applied to stored properties.
5454-
if (var->hasStorage()) {
5447+
// 'nonisolated' can not be applied to mutable stored properties.
5448+
if (var->hasStorage() && var->supportsMutation()) {
54555449
diagnoseAndRemoveAttr(attr, diag::nonisolated_mutable_storage);
54565450
return;
54575451
}

0 commit comments

Comments
 (0)