@@ -8,10 +8,10 @@ import Distributed
8
8
9
9
struct MissingRemoteCall : DistributedActorSystem {
10
10
// expected-error@-1{{struct 'MissingRemoteCall' is missing witness for protocol requirement 'remoteCall'}}
11
- // expected-note@-2{{protocol 'MissingRemoteCall ' requires function 'remoteCall' with signature:}}
11
+ // expected-note@-2{{protocol 'DistributedActorSystem ' requires function 'remoteCall' with signature:}}
12
12
13
13
// expected-error@-4{{struct 'MissingRemoteCall' is missing witness for protocol requirement 'remoteCallVoid'}}
14
- // expected-note@-5{{protocol 'MissingRemoteCall ' requires function 'remoteCallVoid' with signature:}}
14
+ // expected-note@-5{{protocol 'DistributedActorSystem ' requires function 'remoteCallVoid' with signature:}}
15
15
16
16
typealias ActorID = ActorAddress
17
17
typealias InvocationDecoder = FakeInvocationDecoder
@@ -41,6 +41,128 @@ struct MissingRemoteCall: DistributedActorSystem {
41
41
}
42
42
}
43
43
44
+ struct RemoteCallMutating : DistributedActorSystem {
45
+ // expected-error@-1{{struct 'RemoteCallMutating' is missing witness for protocol requirement 'remoteCall'}}
46
+ // expected-note@-2{{protocol 'DistributedActorSystem' requires function 'remoteCall' with signature:}}
47
+
48
+ // expected-error@-4{{struct 'RemoteCallMutating' is missing witness for protocol requirement 'remoteCallVoid'}}
49
+ // expected-note@-5{{protocol 'DistributedActorSystem' requires function 'remoteCallVoid' with signature:}}
50
+
51
+ typealias ActorID = ActorAddress
52
+ typealias InvocationDecoder = FakeInvocationDecoder
53
+ typealias InvocationEncoder = FakeInvocationEncoder
54
+ typealias SerializationRequirement = Codable
55
+ typealias ResultHandler = FakeResultHandler
56
+
57
+ func resolve< Act> ( id: ActorID , as actorType: Act . Type )
58
+ throws -> Act ? where Act: DistributedActor {
59
+ return nil
60
+ }
61
+
62
+ func assignID< Act> ( _ actorType: Act . Type ) -> ActorID
63
+ where Act: DistributedActor {
64
+ ActorAddress ( parse: " fake://123 " )
65
+ }
66
+
67
+ func actorReady< Act> ( _ actor : Act )
68
+ where Act: DistributedActor ,
69
+ Act. ID == ActorID {
70
+ }
71
+
72
+ func resignID( _ id: ActorID ) {
73
+ }
74
+
75
+ mutating func remoteCall< Act, Err, Res> (
76
+ on actor : Act ,
77
+ target: RemoteCallTarget ,
78
+ invocation: inout InvocationEncoder ,
79
+ throwing: Err . Type ,
80
+ returning: Res . Type
81
+ ) async throws -> Res
82
+ where Act: DistributedActor ,
83
+ Act. ID == ActorID ,
84
+ Err: Error ,
85
+ Res: SerializationRequirement {
86
+ fatalError ( " NOT IMPLEMENTED \( #function) " )
87
+ }
88
+
89
+ mutating func remoteCallVoid< Act, Err> (
90
+ on actor : Act ,
91
+ target: RemoteCallTarget ,
92
+ invocation: inout InvocationEncoder ,
93
+ throwing: Err . Type
94
+ ) async throws
95
+ where Act: DistributedActor ,
96
+ Act. ID == ActorID ,
97
+ Err: Error {
98
+ fatalError ( " NOT IMPLEMENTED \( #function) " )
99
+ }
100
+
101
+ func makeInvocationEncoder( ) -> InvocationEncoder {
102
+ }
103
+ }
104
+
105
+ struct MissingRemoteCall_missingInout_on_encoder : DistributedActorSystem {
106
+ // expected-error@-1{{struct 'MissingRemoteCall_missingInout_on_encoder' is missing witness for protocol requirement 'remoteCall'}}
107
+ // expected-note@-2{{protocol 'DistributedActorSystem' requires function 'remoteCall' with signature:}}
108
+
109
+ // expected-error@-4{{struct 'MissingRemoteCall_missingInout_on_encoder' is missing witness for protocol requirement 'remoteCallVoid'}}
110
+ // expected-note@-5{{protocol 'DistributedActorSystem' requires function 'remoteCallVoid' with signature:}}
111
+
112
+ typealias ActorID = ActorAddress
113
+ typealias InvocationDecoder = FakeInvocationDecoder
114
+ typealias InvocationEncoder = FakeInvocationEncoder
115
+ typealias SerializationRequirement = Codable
116
+ typealias ResultHandler = FakeResultHandler
117
+
118
+ func resolve< Act> ( id: ActorID , as actorType: Act . Type )
119
+ throws -> Act ? where Act: DistributedActor {
120
+ return nil
121
+ }
122
+
123
+ func assignID< Act> ( _ actorType: Act . Type ) -> ActorID
124
+ where Act: DistributedActor {
125
+ ActorAddress ( parse: " fake://123 " )
126
+ }
127
+
128
+ func actorReady< Act> ( _ actor : Act )
129
+ where Act: DistributedActor ,
130
+ Act. ID == ActorID {
131
+ }
132
+
133
+ func resignID( _ id: ActorID ) {
134
+ }
135
+
136
+ func remoteCall< Act, Err, Res> (
137
+ on actor : Act ,
138
+ target: RemoteCallTarget ,
139
+ invocation: InvocationEncoder , // MISSING 'inout'
140
+ throwing: Err . Type ,
141
+ returning: Res . Type
142
+ ) async throws -> Res
143
+ where Act: DistributedActor ,
144
+ Act. ID == ActorID ,
145
+ Err: Error ,
146
+ Res: SerializationRequirement {
147
+ fatalError ( " NOT IMPLEMENTED \( #function) " )
148
+ }
149
+
150
+ func remoteCallVoid< Act, Err> (
151
+ on actor : Act ,
152
+ target: RemoteCallTarget ,
153
+ invocation: InvocationEncoder , // MISSING 'inout'
154
+ throwing: Err . Type
155
+ ) async throws
156
+ where Act: DistributedActor ,
157
+ Act. ID == ActorID ,
158
+ Err: Error {
159
+ fatalError ( " NOT IMPLEMENTED \( #function) " )
160
+ }
161
+
162
+ func makeInvocationEncoder( ) -> InvocationEncoder {
163
+ }
164
+ }
165
+
44
166
struct MissingRemoteCall_missing_makeInvocationEncoder : DistributedActorSystem {
45
167
// expected-error@-1{{type 'MissingRemoteCall_missing_makeInvocationEncoder' does not conform to protocol 'DistributedActorSystem'}}
46
168
@@ -99,10 +221,10 @@ struct MissingRemoteCall_missing_makeInvocationEncoder: DistributedActorSystem {
99
221
100
222
struct Error_wrongReturn : DistributedActorSystem {
101
223
// expected-error@-1{{struct 'Error_wrongReturn' is missing witness for protocol requirement 'remoteCall'}}
102
- // expected-note@-2{{protocol 'Error_wrongReturn ' requires function 'remoteCall' with signature:}}
224
+ // expected-note@-2{{protocol 'DistributedActorSystem ' requires function 'remoteCall' with signature:}}
103
225
104
226
// expected-error@-4{{struct 'Error_wrongReturn' is missing witness for protocol requirement 'remoteCallVoid'}}
105
- // expected-note@-5{{protocol 'Error_wrongReturn ' requires function 'remoteCallVoid' with signature:}}
227
+ // expected-note@-5{{protocol 'DistributedActorSystem ' requires function 'remoteCallVoid' with signature:}}
106
228
107
229
typealias ActorID = ActorAddress
108
230
typealias InvocationDecoder = FakeInvocationDecoder
@@ -174,10 +296,10 @@ struct Error_wrongReturn: DistributedActorSystem {
174
296
175
297
struct BadRemoteCall_param : DistributedActorSystem {
176
298
// expected-error@-1{{struct 'BadRemoteCall_param' is missing witness for protocol requirement 'remoteCall'}}
177
- // expected-note@-2{{protocol 'BadRemoteCall_param ' requires function 'remoteCall' with signature:}}
299
+ // expected-note@-2{{protocol 'DistributedActorSystem ' requires function 'remoteCall' with signature:}}
178
300
179
301
// expected-error@-4{{struct 'BadRemoteCall_param' is missing witness for protocol requirement 'remoteCallVoid'}}
180
- // expected-note@-5{{protocol 'BadRemoteCall_param ' requires function 'remoteCallVoid' with signature:}}
302
+ // expected-note@-5{{protocol 'DistributedActorSystem ' requires function 'remoteCallVoid' with signature:}}
181
303
182
304
typealias ActorID = ActorAddress
183
305
typealias InvocationDecoder = FakeInvocationDecoder
@@ -284,7 +406,7 @@ public struct BadRemoteCall_notPublic: DistributedActorSystem {
284
406
285
407
public struct BadRemoteCall_badResultConformance : DistributedActorSystem {
286
408
// expected-error@-1{{struct 'BadRemoteCall_badResultConformance' is missing witness for protocol requirement 'remoteCall'}}
287
- // expected-note@-2{{protocol 'BadRemoteCall_badResultConformance ' requires function 'remoteCall' with signature:}}
409
+ // expected-note@-2{{protocol 'DistributedActorSystem ' requires function 'remoteCall' with signature:}}
288
410
289
411
public typealias ActorID = ActorAddress
290
412
public typealias InvocationDecoder = PublicFakeInvocationDecoder
@@ -391,7 +513,7 @@ struct BadRemoteCall_largeSerializationRequirement: DistributedActorSystem {
391
513
392
514
struct BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition : DistributedActorSystem {
393
515
// expected-error@-1{{struct 'BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition' is missing witness for protocol requirement 'remoteCall'}}
394
- // expected-note@-2{{protocol 'BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition ' requires function 'remoteCall' with signature:}}
516
+ // expected-note@-2{{protocol 'DistributedActorSystem ' requires function 'remoteCall' with signature:}}
395
517
396
518
typealias ActorID = ActorAddress
397
519
typealias InvocationDecoder = LargeSerializationReqFakeInvocationDecoder
@@ -547,7 +669,7 @@ public struct PublicFakeInvocationEncoder: DistributedTargetInvocationEncoder {
547
669
548
670
struct FakeInvocationEncoder_missing_recordArgument : DistributedTargetInvocationEncoder {
549
671
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordArgument' is missing witness for protocol requirement 'recordArgument'}}
550
- //expected-note@-2{{protocol 'FakeInvocationEncoder_missing_recordArgument ' requires function 'recordArgument' with signature:}}
672
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordArgument' with signature:}}
551
673
typealias SerializationRequirement = Codable
552
674
553
675
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -559,7 +681,7 @@ struct FakeInvocationEncoder_missing_recordArgument: DistributedTargetInvocation
559
681
560
682
struct FakeInvocationEncoder_missing_recordArgument2 : DistributedTargetInvocationEncoder {
561
683
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordArgument2' is missing witness for protocol requirement 'recordArgument'}}
562
- //expected-note@-2{{protocol 'FakeInvocationEncoder_missing_recordArgument2 ' requires function 'recordArgument' with signature:}}
684
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordArgument' with signature:}}
563
685
typealias SerializationRequirement = Codable
564
686
565
687
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -571,7 +693,7 @@ struct FakeInvocationEncoder_missing_recordArgument2: DistributedTargetInvocatio
571
693
572
694
struct FakeInvocationEncoder_missing_recordReturnType : DistributedTargetInvocationEncoder {
573
695
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordReturnType' is missing witness for protocol requirement 'recordReturnType'}}
574
- //expected-note@-2{{protocol 'FakeInvocationEncoder_missing_recordReturnType ' requires function 'recordReturnType' with signature:}}
696
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordReturnType' with signature:}}
575
697
typealias SerializationRequirement = Codable
576
698
577
699
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -594,7 +716,7 @@ struct FakeInvocationEncoder_missing_recordErrorType: DistributedTargetInvocatio
594
716
595
717
struct FakeInvocationEncoder_recordArgument_wrongType : DistributedTargetInvocationEncoder {
596
718
//expected-error@-1{{struct 'FakeInvocationEncoder_recordArgument_wrongType' is missing witness for protocol requirement 'recordArgument'}}
597
- //expected-note@-2{{protocol 'FakeInvocationEncoder_recordArgument_wrongType ' requires function 'recordArgument' with signature:}}
719
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordArgument' with signature:}}
598
720
typealias SerializationRequirement = Codable
599
721
600
722
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -607,7 +729,7 @@ struct FakeInvocationEncoder_recordArgument_wrongType: DistributedTargetInvocati
607
729
}
608
730
struct FakeInvocationEncoder_recordArgument_missingMutating : DistributedTargetInvocationEncoder {
609
731
//expected-error@-1{{struct 'FakeInvocationEncoder_recordArgument_missingMutating' is missing witness for protocol requirement 'recordArgument'}}
610
- //expected-note@-2{{protocol 'FakeInvocationEncoder_recordArgument_missingMutating ' requires function 'recordArgument' with signature:}}
732
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordArgument' with signature:}}
611
733
typealias SerializationRequirement = Codable
612
734
613
735
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -619,7 +741,7 @@ struct FakeInvocationEncoder_recordArgument_missingMutating: DistributedTargetIn
619
741
620
742
struct FakeInvocationEncoder_recordResultType_wrongType : DistributedTargetInvocationEncoder {
621
743
//expected-error@-1{{struct 'FakeInvocationEncoder_recordResultType_wrongType' is missing witness for protocol requirement 'recordReturnType'}}
622
- //expected-note@-2{{protocol 'FakeInvocationEncoder_recordResultType_wrongType ' requires function 'recordReturnType' with signature:}}
744
+ //expected-note@-2{{protocol 'DistributedTargetInvocationEncoder ' requires function 'recordReturnType' with signature:}}
623
745
typealias SerializationRequirement = Codable
624
746
625
747
mutating func recordGenericSubstitution< T> ( _ type: T . Type ) throws { }
@@ -696,7 +818,7 @@ public final class PublicFakeInvocationDecoder_badNotPublic: DistributedTargetIn
696
818
697
819
final class PublicFakeInvocationDecoder_badBadProtoRequirement : DistributedTargetInvocationDecoder {
698
820
// expected-error@-1{{class 'PublicFakeInvocationDecoder_badBadProtoRequirement' is missing witness for protocol requirement 'decodeNextArgument'}}
699
- // expected-note@-2{{protocol 'PublicFakeInvocationDecoder_badBadProtoRequirement ' requires function 'decodeNextArgument' with signature:}}
821
+ // expected-note@-2{{protocol 'DistributedTargetInvocationDecoder ' requires function 'decodeNextArgument' with signature:}}
700
822
typealias SerializationRequirement = Codable
701
823
702
824
func decodeGenericSubstitutions( ) throws -> [ Any . Type ] { [ ] }
@@ -748,7 +870,7 @@ struct LargeSerializationReqFakeInvocationResultHandler: DistributedTargetInvoca
748
870
749
871
struct BadResultHandler_missingOnReturn : DistributedTargetInvocationResultHandler {
750
872
// expected-error@-1{{struct 'BadResultHandler_missingOnReturn' is missing witness for protocol requirement 'onReturn'}}
751
- // expected-note@-2{{protocol 'BadResultHandler_missingOnReturn ' requires function 'onReturn' with signature:}}
873
+ // expected-note@-2{{protocol 'DistributedTargetInvocationResultHandler ' requires function 'onReturn' with signature:}}
752
874
typealias SerializationRequirement = Codable
753
875
754
876
// func onReturn<Res: SerializationRequirement>(value: Res) async throws {} // MISSING
@@ -758,7 +880,7 @@ struct BadResultHandler_missingOnReturn: DistributedTargetInvocationResultHandle
758
880
759
881
struct BadResultHandler_missingRequirement : DistributedTargetInvocationResultHandler {
760
882
// expected-error@-1{{struct 'BadResultHandler_missingRequirement' is missing witness for protocol requirement 'onReturn'}}
761
- // expected-note@-2{{protocol 'BadResultHandler_missingRequirement ' requires function 'onReturn' with signature:}}
883
+ // expected-note@-2{{protocol 'DistributedTargetInvocationResultHandler ' requires function 'onReturn' with signature:}}
762
884
typealias SerializationRequirement = Codable
763
885
764
886
func onReturn< Success> ( value: Success ) async throws { } // MISSING : Codable
@@ -767,8 +889,8 @@ struct BadResultHandler_missingRequirement: DistributedTargetInvocationResultHan
767
889
}
768
890
769
891
struct BadResultHandler_mutatingButShouldNotBe : DistributedTargetInvocationResultHandler {
770
- // expected-error@-1{{struct 'BadResultHandler_missingRequirement ' is missing witness for protocol requirement 'onReturn'}}
771
- // expected-note@-2{{protocol 'BadResultHandler_missingRequirement ' requires function 'onReturn' with signature:}}
892
+ // expected-error@-1{{struct 'BadResultHandler_mutatingButShouldNotBe ' is missing witness for protocol requirement 'onReturn'}}
893
+ // expected-note@-2{{protocol 'DistributedTargetInvocationResultHandler ' requires function 'onReturn' with signature:}}
772
894
typealias SerializationRequirement = Codable
773
895
774
896
mutating func onReturn< Success: Codable > ( value: Success ) async throws { } // WRONG: can't be mutating
0 commit comments