Skip to content

Commit 849e9d6

Browse files
committed
fix diagnostic messages that said '@actorisolated' for @actorIndependent
1 parent 68b790f commit 849e9d6

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4207,22 +4207,22 @@ ERROR(global_actor_isolated_requirement_witness_conflict,none,
42074207
"requirement from protocol %3 isolated to global actor %4",
42084208
(DescriptiveDeclKind, DeclName, Type, Identifier, Type))
42094209

4210-
ERROR(actorisolated_let,none,
4211-
"'@actorIsolated' is meaningless on 'let' declarations because "
4210+
ERROR(actorindependent_let,none,
4211+
"'@actorIndependent' is meaningless on 'let' declarations because "
42124212
"they are immutable",
42134213
())
4214-
ERROR(actorisolated_mutable_storage,none,
4215-
"'@actorIsolated' can not be applied to stored properties",
4214+
ERROR(actorindependent_mutable_storage,none,
4215+
"'@actorIndependent' can not be applied to stored properties",
42164216
())
4217-
ERROR(actorisolated_local_var,none,
4218-
"'@actorIsolated' can not be applied to local variables",
4217+
ERROR(actorindependent_local_var,none,
4218+
"'@actorIndependent' can not be applied to local variables",
42194219
())
4220-
ERROR(actorisolated_not_actor_member,none,
4221-
"'@actorIsolated' can only be applied to actor members and "
4220+
ERROR(actorindependent_not_actor_member,none,
4221+
"'@actorIndependent' can only be applied to actor members and "
42224222
"global/static variables",
42234223
())
4224-
ERROR(actorisolated_not_actor_instance_member,none,
4225-
"'@actorIsolated' can only be applied to instance members of actors",
4224+
ERROR(actorindependent_not_actor_instance_member,none,
4225+
"'@actorIndependent' can only be applied to instance members of actors",
42264226
())
42274227

42284228
ERROR(concurrency_lib_missing,none,

lib/Sema/TypeCheckAttr.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,19 +286,19 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
286286
if (auto var = dyn_cast<VarDecl>(D)) {
287287
// @actorIndependent is meaningless on a `let`.
288288
if (var->isLet()) {
289-
diagnoseAndRemoveAttr(attr, diag::actorisolated_let);
289+
diagnoseAndRemoveAttr(attr, diag::actorindependent_let);
290290
return;
291291
}
292292

293293
// @actorIndependent can not be applied to stored properties.
294294
if (var->hasStorage()) {
295-
diagnoseAndRemoveAttr(attr, diag::actorisolated_mutable_storage);
295+
diagnoseAndRemoveAttr(attr, diag::actorindependent_mutable_storage);
296296
return;
297297
}
298298

299299
// @actorIndependent can not be applied to local properties.
300300
if (dc->isLocalContext()) {
301-
diagnoseAndRemoveAttr(attr, diag::actorisolated_local_var);
301+
diagnoseAndRemoveAttr(attr, diag::actorindependent_local_var);
302302
return;
303303
}
304304

@@ -315,14 +315,14 @@ class AttributeChecker : public AttributeVisitor<AttributeChecker> {
315315
// @actorIndependent only makes sense on an actor instance member.
316316
if (!dc->getSelfClassDecl() ||
317317
!dc->getSelfClassDecl()->isActor()) {
318-
diagnoseAndRemoveAttr(attr, diag::actorisolated_not_actor_member);
318+
diagnoseAndRemoveAttr(attr, diag::actorindependent_not_actor_member);
319319
return;
320320
}
321321

322322
auto VD = cast<ValueDecl>(D);
323323
if (!VD->isInstanceMember()) {
324324
diagnoseAndRemoveAttr(
325-
attr, diag::actorisolated_not_actor_instance_member);
325+
attr, diag::actorindependent_not_actor_instance_member);
326326
return;
327327
}
328328

test/attr/actorindependent.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-swift-frontend -typecheck -verify %s -enable-experimental-concurrency
22

3-
// expected-error@+1{{'@actorIsolated' can only be applied to actor members and global/static variables}}
3+
// expected-error@+1{{'@actorIndependent' can only be applied to actor members and global/static variables}}
44
@actorIndependent func globalFunction() { }
55

66
@actorIndependent var globalComputedProperty1: Int { 17 }
@@ -10,7 +10,7 @@
1010
set { }
1111
}
1212

13-
// expected-error@+1{{'@actorIsolated' can not be applied to stored properties}}
13+
// expected-error@+1{{'@actorIndependent' can not be applied to stored properties}}
1414
@actorIndependent var globalStoredProperty: Int = 17
1515

1616
struct X {
@@ -25,21 +25,21 @@ struct X {
2525
set { }
2626
}
2727

28-
// expected-error@+1{{'@actorIsolated' can not be applied to stored properties}}
28+
// expected-error@+1{{'@actorIndependent' can not be applied to stored properties}}
2929
@actorIndependent
3030
static var storedStaticProperty: Int = 17
3131
}
3232

3333
class C {
34-
// expected-error@+1{{'@actorIsolated' can only be applied to actor members and global/static variables}}
34+
// expected-error@+1{{'@actorIndependent' can only be applied to actor members and global/static variables}}
3535
@actorIndependent
3636
var property3: Int { 5 }
3737
}
3838

3939
actor class A {
4040
var property: Int = 5
4141

42-
// expected-error@+1{{'@actorIsolated' can not be applied to stored properties}}
42+
// expected-error@+1{{'@actorIndependent' can not be applied to stored properties}}
4343
@actorIndependent
4444
var property2: Int = 5
4545

@@ -72,6 +72,6 @@ actor class A {
7272
@actorIndependent
7373
subscript(index: Int) -> String { "\(index)" }
7474

75-
// expected-error@+1{{'@actorIsolated' can only be applied to instance members of actors}}
75+
// expected-error@+1{{'@actorIndependent' can only be applied to instance members of actors}}
7676
@actorIndependent static func staticFunc() { }
7777
}

0 commit comments

Comments
 (0)