Skip to content

Commit 628af8d

Browse files
committed
nonisolated is permitted on a let nowadays
1 parent a3aa341 commit 628af8d

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
@@ -5483,14 +5483,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
54835483
// that do not have storage.
54845484
auto dc = D->getDeclContext();
54855485
if (auto var = dyn_cast<VarDecl>(D)) {
5486-
// 'nonisolated' is meaningless on a `let`.
5487-
if (var->isLet()) {
5488-
diagnoseAndRemoveAttr(attr, diag::nonisolated_let);
5489-
return;
5490-
}
5491-
5492-
// 'nonisolated' can not be applied to stored properties.
5493-
if (var->hasStorage()) {
5486+
// 'nonisolated' can not be applied to mutable stored properties.
5487+
if (var->hasStorage() && var->supportsMutation()) {
54945488
diagnoseAndRemoveAttr(attr, diag::nonisolated_mutable_storage);
54955489
return;
54965490
}

0 commit comments

Comments
 (0)