File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -3230,9 +3230,9 @@ ActorIsolation ActorIsolationRequest::evaluate(
3230
3230
}
3231
3231
}
3232
3232
3233
- // An actor's convenience init is assumed to be actor-independent.
3233
+ // Every actor's convenience init is assumed to be actor-independent.
3234
3234
if (auto nominal = value->getDeclContext ()->getSelfNominalTypeDecl ())
3235
- if (nominal->isActor ())
3235
+ if (nominal->isAnyActor ())
3236
3236
if (auto ctor = dyn_cast<ConstructorDecl>(value))
3237
3237
if (ctor->isConvenienceInit ())
3238
3238
defaultIsolation = ActorIsolation::forIndependent ();
Original file line number Diff line number Diff line change @@ -172,3 +172,13 @@ func test_params(
172
172
_ = try await distributed. distInt ( int: 42 ) // ok
173
173
_ = try await distributed. dist ( notCodable: . init( ) )
174
174
}
175
+
176
+ // Actor initializer isolation (through typechecking only!)
177
+ distributed actor DijonMustard {
178
+ convenience init ( conv: ActorTransport ) {
179
+ self . init ( transport: conv)
180
+ self . f ( ) // expected-error {{actor-isolated instance method 'f()' can not be referenced from a non-isolated context}}
181
+ }
182
+
183
+ func f( ) { } // expected-note {{distributed actor-isolated instance method 'f()' declared here}}
184
+ }
You can’t perform that action at this time.
0 commit comments