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 b09c55a commit b4fa392Copy full SHA for b4fa392
lib/Sema/TypeCheckAttr.cpp
@@ -5444,14 +5444,8 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
5444
// that do not have storage.
5445
auto dc = D->getDeclContext();
5446
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()) {
+ // 'nonisolated' can not be applied to mutable stored properties.
+ if (var->hasStorage() && var->supportsMutation()) {
5455
diagnoseAndRemoveAttr(attr, diag::nonisolated_mutable_storage);
5456
return;
5457
}
0 commit comments