File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -707,10 +707,6 @@ SILFunction *SILGenModule::emitProtocolWitness(
707
707
!requirement.getFuncDecl ()->isDistributed () &&
708
708
witnessRef.hasDecl () && witnessRef.getFuncDecl () &&
709
709
witnessRef.getFuncDecl ()->isDistributed ());
710
- // We only need to use thunks when we go cross-actor:
711
- shouldUseDistributedThunkWitness = shouldUseDistributedThunkWitness &&
712
- getActorIsolation (requirement.getDecl ()) !=
713
- getActorIsolation (witness.getDecl ());
714
710
if (shouldUseDistributedThunkWitness) {
715
711
auto thunkDeclRef = SILDeclRef (
716
712
witnessRef.getFuncDecl ()->getDistributedThunk (),
Original file line number Diff line number Diff line change @@ -59,3 +59,29 @@ distributed actor DA4: ServerProto {
59
59
// CHECK: function_ref @$s17distributed_thunk3DA4C11doSomethingyyYaKFTE
60
60
distributed func doSomething( ) throws { }
61
61
}
62
+
63
+ protocol Server2 : DistributedActor {
64
+ distributed func sayHello( )
65
+ }
66
+
67
+ extension Server2 where ActorSystem == LocalTestingDistributedActorSystem {
68
+ // CHECK-LABEL: sil hidden [thunk] [distributed] [ref_adhoc_requirement_witness "$s11Distributed29LocalTestingInvocationDecoderC18decodeNextArgumentxyKSeRzSERzlF"] [ossa] @$s17distributed_thunk7Server2PAA11Distributed012LocalTestingD11ActorSystemC0gH0RtzrlE8sayHelloyyYaKFTE
69
+ // CHECK-NOT: return
70
+ // CHECK: function_ref @swift_distributed_actor_is_remote
71
+ distributed func sayHello( ) { /* default impl */ }
72
+
73
+ // CHECK-LABEL: sil hidden [distributed] [ossa] @$s17distributed_thunk7Server2PAA11Distributed012LocalTestingD11ActorSystemC0gH0RtzrlE8sayHelloyyF
74
+ // CHECK-NOT: swift_distributed_actor_is_remote
75
+ // CHECK: return
76
+ }
77
+
78
+ distributed actor DA5 : Server2 {
79
+ typealias ActorSystem = LocalTestingDistributedActorSystem
80
+ // uses default impl
81
+
82
+ // CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s17distributed_thunk3DA5CAA7Server2A2aDP8sayHelloyyFTW
83
+ // CHECK: function_ref @$s17distributed_thunk7Server2PAA11Distributed012LocalTestingD11ActorSystemC0gH0RtzrlE8sayHelloyyF
84
+
85
+ // CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s17distributed_thunk3DA5CAA7Server2A2aDP8sayHelloyyFTWTE
86
+ // CHECK: function_ref @$s17distributed_thunk7Server2PAA11Distributed012LocalTestingD11ActorSystemC0gH0RtzrlE8sayHelloyyYaKFTE
87
+ }
You can’t perform that action at this time.
0 commit comments