Skip to content

Commit acff772

Browse files
committed
adjust ast test for new contidion
1 parent 368d4c4 commit acff772

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/Distributed/distributed_actor_executor_ast.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,26 @@ distributed actor DefaultWorker {
2323
// empty on purpose, default executor
2424
}
2525

26+
// Check DefaultWorker, the DefaultActor version of the synthesis:
2627
// CHECK: (class_decl range=[{{.*}}] "DefaultWorker" interface type='DefaultWorker.Type' access=internal non-resilient actor
28+
// The unowned executor property:
2729
// CHECK: (var_decl implicit "unownedExecutor" type='Optional<UnownedSerialExecutor>' interface type='Optional<UnownedSerialExecutor>' access=internal final readImpl=getter immutable
2830
// CHECK: (accessor_decl implicit 'anonname={{.*}}' interface type='(DefaultWorker) -> () -> Optional<UnownedSerialExecutor>' access=internal final get_for=unownedExecutor
2931
// CHECK: (parameter "self" type='DefaultWorker' interface type='DefaultWorker')
3032
// CHECK: (parameter_list)
3133
// 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:
3246
// CHECK: (return_stmt implicit
3347
// CHECK: (inject_into_optional implicit type='Optional<UnownedSerialExecutor>'
3448
// CHECK: (call_expr implicit type='UnownedSerialExecutor' nothrow

0 commit comments

Comments
 (0)