@@ -23,12 +23,26 @@ distributed actor DefaultWorker {
23
23
// empty on purpose, default executor
24
24
}
25
25
26
+ // Check DefaultWorker, the DefaultActor version of the synthesis:
26
27
// CHECK: (class_decl range=[{{.*}}] "DefaultWorker" interface type='DefaultWorker.Type' access=internal non-resilient actor
28
+ // The unowned executor property:
27
29
// CHECK: (var_decl implicit "unownedExecutor" type='Optional<UnownedSerialExecutor>' interface type='Optional<UnownedSerialExecutor>' access=internal final readImpl=getter immutable
28
30
// CHECK: (accessor_decl implicit 'anonname={{.*}}' interface type='(DefaultWorker) -> () -> Optional<UnownedSerialExecutor>' access=internal final get_for=unownedExecutor
29
31
// CHECK: (parameter "self" type='DefaultWorker' interface type='DefaultWorker')
30
32
// CHECK: (parameter_list)
31
33
// CHECK: (brace_stmt implicit
34
+ // We guard the rest of the body; we only return a default executor if the actor is local:
35
+ // CHECK: (guard_stmt implicit
36
+ // CHECK: (call_expr implicit type='Bool' nothrow
37
+ // CHECK: (declref_expr implicit type='@_NO_EXTINFO (AnyObject) -> Bool' decl=Distributed.(file).__isLocalActor function_ref=unapplied)
38
+ // CHECK: (argument_list implicit
39
+ // CHECK: (argument
40
+ // CHECK: (erasure_expr implicit type='AnyObject'
41
+ // CHECK: (declref_expr implicit type='DefaultWorker' decl=main.(file).DefaultWorker.<anonymous>.self function_ref=unapplied)))))
42
+ // CHECK: (brace_stmt implicit
43
+ // CHECK: (return_stmt implicit
44
+ // CHECK: (nil_literal_expr implicit type='Optional<UnownedSerialExecutor>' initializer=**NULL**))))
45
+ // If the actor is not local, we return a default executor for it, same as normal actors:
32
46
// CHECK: (return_stmt implicit
33
47
// CHECK: (inject_into_optional implicit type='Optional<UnownedSerialExecutor>'
34
48
// CHECK: (call_expr implicit type='UnownedSerialExecutor' nothrow
0 commit comments