Skip to content

Commit 3f97abf

Browse files
authored
Merge pull request #36557 from etcwilde/ewilde/expunge-actor-class-diagnostics
[concurrency] Expunge 'actor class' from diagnostics
2 parents 8978dc8 + d572c75 commit 3f97abf

File tree

11 files changed

+15
-15
lines changed

11 files changed

+15
-15
lines changed

include/swift/AST/ActorIsolation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ActorIsolation {
4040
/// The actor isolation has not been specified. It is assumed to be
4141
/// unsafe to interact with this declaration from any actor.
4242
Unspecified = 0,
43-
/// The declaration is isolated to the instance of an actor class.
43+
/// The declaration is isolated to the instance of an actor.
4444
/// For example, a mutable stored property or synchronous function within
4545
/// the actor is isolated to the instance of that actor.
4646
ActorInstance,

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4323,7 +4323,7 @@ ERROR(async_objc_dynamic_self,none,
43234323
"asynchronous method returning 'Self' cannot be '@objc'", ())
43244324

43254325
ERROR(actor_with_nonactor_superclass,none,
4326-
"actor class cannot inherit from non-actor class %0", (DeclName))
4326+
"actor cannot inherit from non-actor class %0", (DeclName))
43274327

43284328
ERROR(actor_isolated_non_self_reference,none,
43294329
"actor-isolated %0 %1 can only be %select{referenced|mutated|used 'inout'}3 "
@@ -4500,7 +4500,7 @@ ERROR(multiple_global_actors,none,
45004500
ERROR(global_actor_disallowed,none,
45014501
"%0 cannot have a global actor", (DescriptiveDeclKind))
45024502
ERROR(global_actor_on_actor_class,none,
4503-
"actor class %0 cannot have a global actor", (Identifier))
4503+
"actor %0 cannot have a global actor", (Identifier))
45044504
ERROR(global_actor_on_local_variable,none,
45054505
"local variable %0 cannot have a global actor", (DeclName))
45064506
ERROR(global_actor_non_unsafe_init,none,

lib/Frontend/ModuleInterfaceSupport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ class InheritedProtocolCollector {
521521
if (!printOptions.shouldPrint(nominal))
522522
return;
523523

524-
/// is this nominal specifically an 'actor class'?
524+
/// is this nominal specifically an 'actor'?
525525
bool actorClass = false;
526526
if (auto klass = dyn_cast<ClassDecl>(nominal))
527527
actorClass = klass->isActor();

lib/IRGen/GenType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2095,7 +2095,7 @@ const TypeInfo *TypeConverter::convertType(CanType ty) {
20952095
}
20962096
case TypeKind::BuiltinDefaultActorStorage: {
20972097
// Builtin.DefaultActorStorage represents the extra storage
2098-
// (beyond the heap header) of a default actor class. It is
2098+
// (beyond the heap header) of a default actor. It is
20992099
// fixed-size and totally opaque.
21002100
auto numWords = NumWords_DefaultActor;
21012101

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,18 +290,18 @@ bool IsActorRequest::evaluate(
290290

291291
bool IsDefaultActorRequest::evaluate(
292292
Evaluator &evaluator, ClassDecl *classDecl) const {
293-
// If the class isn't an actor class, it's not a default actor.
293+
// If the class isn't an actor, it's not a default actor.
294294
if (!classDecl->isActor())
295295
return false;
296296

297-
// If there is a superclass, and it's an actor class, we defer
297+
// If there is a superclass, and it's an actor, we defer
298298
// the decision to it.
299299
if (auto superclassDecl = classDecl->getSuperclassDecl()) {
300300
// If the superclass is an actor, we inherit its default-actor-ness.
301301
if (superclassDecl->isActor())
302302
return superclassDecl->isDefaultActor();
303303

304-
// If the superclass is not an actor class, it can only be
304+
// If the superclass is not an actor, it can only be
305305
// a default actor if it's NSObject. (For now, other classes simply
306306
// can't be actors at all.) We don't need to diagnose this; we
307307
// should've done that already in isActor().
@@ -522,7 +522,7 @@ GlobalActorAttributeRequest::evaluate(
522522
// Nominal types are okay...
523523
if (auto classDecl = dyn_cast<ClassDecl>(nominal)){
524524
if (classDecl->isActor()) {
525-
// ... except for actor classes.
525+
// ... except for actors.
526526
nominal->diagnose(diag::global_actor_on_actor_class, nominal->getName())
527527
.highlight(globalActorAttr->getRangeWithAt());
528528
return None;

lib/Sema/TypeCheckConcurrency.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class ActorIsolationRestriction {
132132
return data.actorType;
133133
}
134134

135-
/// Retrieve the actor class that the declaration is within.
135+
/// Retrieve the actor that the declaration is within.
136136
Type getGlobalActor() const {
137137
assert(kind == GlobalActor || kind == GlobalActorUnsafe);
138138
return Type(data.globalActor);

lib/Sema/TypeCheckStorage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void computeLoweredStoredProperties(NominalTypeDecl *decl) {
118118
}
119119
}
120120

121-
// If this is an actor class, check conformance to the Actor protocol to
121+
// If this is an actor, check conformance to the Actor protocol to
122122
// ensure that the actor storage will get created (if needed).
123123
if (auto classDecl = dyn_cast<ClassDecl>(decl)) {
124124
if (classDecl->isActor()) {

stdlib/public/Concurrency/Actor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import Swift
1414
@_implementationOnly import _SwiftConcurrencyShims
1515

16-
/// Common protocol to which all actor classes conform.
16+
/// Common protocol to which all actors conform.
1717
///
1818
/// The \c Actor protocol generalizes over all actor types. Actor types
1919
/// implicitly conform to this protocol.

test/attr/global_actor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class SomeClass {
8383

8484
@GA1 typealias Integer = Int // expected-error{{type alias cannot have a global actor}}
8585

86-
@GA1 actor ActorInTooManyPlaces { } // expected-error{{actor class 'ActorInTooManyPlaces' cannot have a global actor}}
86+
@GA1 actor ActorInTooManyPlaces { } // expected-error{{actor 'ActorInTooManyPlaces' cannot have a global actor}}
8787

8888
@GA1 @OtherGlobalActor func twoGlobalActors() { } // expected-error{{declaration can not have multiple global actor attributes ('OtherGlobalActor' and 'GA1')}}
8989

test/decl/class/actor/basic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ actor class MyActorClass { }
1313

1414
class NonActor { }
1515

16-
actor NonActorSubclass : NonActor { } // expected-error{{actor class cannot inherit from non-actor class 'NonActor'}}
16+
actor NonActorSubclass : NonActor { } // expected-error{{actor cannot inherit from non-actor class 'NonActor'}}
1717

1818
// expected-warning@+1{{'actor class' has been renamed to 'actor'}}{{14-20=}}
1919
public actor class BobHope {}

unittests/runtime/Actor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void run(llvm::function_ref<void()> fn) {
8585

8686
namespace {
8787

88-
/// A simple actor class.
88+
/// A simple actor.
8989
class TestActor : public DefaultActor {
9090
public:
9191
TestActor();

0 commit comments

Comments
 (0)