We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
nonisolated
let
1 parent a3aa341 commit 628af8dCopy full SHA for 628af8d
lib/Sema/TypeCheckAttr.cpp
@@ -5483,14 +5483,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
5483
// that do not have storage.
5484
auto dc = D->getDeclContext();
5485
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()) {
+ // 'nonisolated' can not be applied to mutable stored properties.
+ if (var->hasStorage() && var->supportsMutation()) {
5494
diagnoseAndRemoveAttr(attr, diag::nonisolated_mutable_storage);
5495
return;
5496
}
0 commit comments