mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Tests] NFC: Adjust distributed actor test-cases changed/improved due to new requirements
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import Distributed
|
||||
|
||||
struct MissingRemoteCall: DistributedActorSystem {
|
||||
struct MissingRemoteCall: DistributedActorSystem { // expected-error {{type 'MissingRemoteCall' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'MissingRemoteCall' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}{{51-51=\nfunc remoteCall<Act, Err, Res>(on actor: Act, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res where Act: DistributedActor, Act.ID == ActorID, Err: Error, Res: SerializationRequirement {\n <#code#>\n}\n}}
|
||||
|
||||
@@ -41,7 +41,7 @@ struct MissingRemoteCall: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
public struct PublicMissingRemoteCall: DistributedActorSystem {
|
||||
public struct PublicMissingRemoteCall: DistributedActorSystem { // expected-error {{type 'PublicMissingRemoteCall' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'PublicMissingRemoteCall' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}{{64-64=\npublic func remoteCall<Act, Err, Res>(on actor: Act, target: RemoteCallTarget, invocation: inout InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res where Act: DistributedActor, Act.ID == ActorID, Err: Error, Res: SerializationRequirement {\n <#code#>\n}\n}}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
import Distributed
|
||||
|
||||
struct MissingRemoteCall: DistributedActorSystem {
|
||||
struct MissingRemoteCall: DistributedActorSystem { // expected-error {{type 'MissingRemoteCall' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'MissingRemoteCall' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -41,7 +41,7 @@ struct MissingRemoteCall: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
struct RemoteCallMutating: DistributedActorSystem {
|
||||
struct RemoteCallMutating: DistributedActorSystem { // expected-error {{type 'RemoteCallMutating' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'RemoteCallMutating' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -72,6 +72,7 @@ struct RemoteCallMutating: DistributedActorSystem {
|
||||
func resignID(_ id: ActorID) {
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate is marked 'mutating' but protocol does not allow it}}
|
||||
mutating func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -86,6 +87,7 @@ struct RemoteCallMutating: DistributedActorSystem {
|
||||
fatalError("NOT IMPLEMENTED \(#function)")
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate is marked 'mutating' but protocol does not allow it}}
|
||||
mutating func remoteCallVoid<Act, Err>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -102,7 +104,7 @@ struct RemoteCallMutating: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
struct MissingRemoteCall_missingInout_on_encoder: DistributedActorSystem {
|
||||
struct MissingRemoteCall_missingInout_on_encoder: DistributedActorSystem { // expected-error {{type 'MissingRemoteCall_missingInout_on_encoder' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'MissingRemoteCall_missingInout_on_encoder' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -133,6 +135,7 @@ struct MissingRemoteCall_missingInout_on_encoder: DistributedActorSystem {
|
||||
func resignID(_ id: ActorID) {
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: MissingRemoteCall_missingInout_on_encoder.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: FakeInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res')}}
|
||||
func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -147,6 +150,7 @@ struct MissingRemoteCall_missingInout_on_encoder: DistributedActorSystem {
|
||||
fatalError("NOT IMPLEMENTED \(#function)")
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err> (on: Act, target: RemoteCallTarget, invocation: MissingRemoteCall_missingInout_on_encoder.InvocationEncoder, throwing: Err.Type) async throws -> ()' (aka '<Act, Err> (on: Act, target: RemoteCallTarget, invocation: FakeInvocationEncoder, throwing: Err.Type) async throws -> ()')}}
|
||||
func remoteCallVoid<Act, Err>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -219,7 +223,7 @@ struct MissingRemoteCall_missing_makeInvocationEncoder: DistributedActorSystem {
|
||||
// func makeInvocationEncoder() -> InvocationEncoder {} // MISSING
|
||||
}
|
||||
|
||||
struct Error_wrongReturn: DistributedActorSystem {
|
||||
struct Error_wrongReturn: DistributedActorSystem { // expected-error {{type 'Error_wrongReturn' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'Error_wrongReturn' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -253,6 +257,7 @@ struct Error_wrongReturn: DistributedActorSystem {
|
||||
func makeInvocationEncoder() -> InvocationEncoder {
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout Error_wrongReturn.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> String' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout FakeInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> String')}}
|
||||
public func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -267,6 +272,7 @@ struct Error_wrongReturn: DistributedActorSystem {
|
||||
throw ExecuteDistributedTargetError(message: "\(#function) not implemented.")
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout Error_wrongReturn.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> ()' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout FakeInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> ()')}}
|
||||
public func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -281,6 +287,7 @@ struct Error_wrongReturn: DistributedActorSystem {
|
||||
throw ExecuteDistributedTargetError(message: "\(#function) not implemented.")
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err> (on: Act, target: RemoteCallTarget, invocation: inout Error_wrongReturn.InvocationEncoder, throwing: Err.Type) throws -> String' (aka '<Act, Err> (on: Act, target: RemoteCallTarget, invocation: inout FakeInvocationEncoder, throwing: Err.Type) throws -> String')}}
|
||||
public func remoteCallVoid<Act, Err>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -294,7 +301,7 @@ struct Error_wrongReturn: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
struct BadRemoteCall_param: DistributedActorSystem {
|
||||
struct BadRemoteCall_param: DistributedActorSystem { // expected-error {{type 'BadRemoteCall_param' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'BadRemoteCall_param' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -375,7 +382,9 @@ public struct BadRemoteCall_notPublic: DistributedActorSystem {
|
||||
public func makeInvocationEncoder() -> InvocationEncoder {
|
||||
}
|
||||
|
||||
// expected-error@+1{{method 'remoteCall(on:target:invocation:throwing:returning:)' must be as accessible as its enclosing type because it matches a requirement in protocol 'DistributedActorSystem'}}
|
||||
// expected-error@+3{{method 'remoteCall(on:target:invocation:throwing:returning:)' must be as accessible as its enclosing type because it matches a requirement in protocol 'DistributedActorSystem'}}
|
||||
// expected-error@+2 {{method 'remoteCall(on:target:invocation:throwing:returning:)' must be declared public because it matches a requirement in public protocol 'DistributedActorSystem'}}
|
||||
// expected-note@+1 {{mark the instance method as 'public' to satisfy the requirement}}
|
||||
func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -390,7 +399,9 @@ public struct BadRemoteCall_notPublic: DistributedActorSystem {
|
||||
throw ExecuteDistributedTargetError(message: "\(#function) not implemented.")
|
||||
}
|
||||
|
||||
// expected-error@+1{{method 'remoteCallVoid(on:target:invocation:throwing:)' must be as accessible as its enclosing type because it matches a requirement in protocol 'DistributedActorSystem'}}
|
||||
// expected-error@+3{{method 'remoteCallVoid(on:target:invocation:throwing:)' must be as accessible as its enclosing type because it matches a requirement in protocol 'DistributedActorSystem'}}
|
||||
// expected-error@+2 {{method 'remoteCallVoid(on:target:invocation:throwing:)' must be declared public because it matches a requirement in public protocol 'DistributedActorSystem'}}
|
||||
// expected-note@+1 {{mark the instance method as 'public' to satisfy the requirement}}
|
||||
func remoteCallVoid<Act, Err>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -404,7 +415,7 @@ public struct BadRemoteCall_notPublic: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
public struct BadRemoteCall_badResultConformance: DistributedActorSystem {
|
||||
public struct BadRemoteCall_badResultConformance: DistributedActorSystem { // expected-error {{type 'BadRemoteCall_badResultConformance' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'BadRemoteCall_badResultConformance' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -431,6 +442,7 @@ public struct BadRemoteCall_badResultConformance: DistributedActorSystem {
|
||||
public func makeInvocationEncoder() -> InvocationEncoder {
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout BadRemoteCall_badResultConformance.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout PublicFakeInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res')}}
|
||||
public func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -511,7 +523,7 @@ struct BadRemoteCall_largeSerializationRequirement: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
struct BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition: DistributedActorSystem {
|
||||
struct BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition: DistributedActorSystem { // expected-error {{type 'BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition' does not conform to protocol 'DistributedActorSystem'}}
|
||||
// expected-error@-1{{struct 'BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition' is missing witness for protocol requirement 'remoteCall'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
|
||||
@@ -538,6 +550,7 @@ struct BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition: Distr
|
||||
func makeInvocationEncoder() -> InvocationEncoder {
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout BadRemoteCall_largeSerializationRequirementSlightlyOffInDefinition.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout LargeSerializationReqFakeInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res')}}
|
||||
func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -667,7 +680,7 @@ public struct PublicFakeInvocationEncoder: DistributedTargetInvocationEncoder {
|
||||
public mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
struct FakeInvocationEncoder_missing_recordArgument: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_missing_recordArgument: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_missing_recordArgument' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordArgument' is missing witness for protocol requirement 'recordArgument'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
@@ -679,19 +692,20 @@ struct FakeInvocationEncoder_missing_recordArgument: DistributedTargetInvocation
|
||||
mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
struct FakeInvocationEncoder_missing_recordArgument2: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_missing_recordArgument2: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_missing_recordArgument2' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordArgument2' is missing witness for protocol requirement 'recordArgument'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
|
||||
mutating func recordGenericSubstitution<T>(_ type: T.Type) throws {}
|
||||
// expected-note@+1 {{candidate has non-matching type '<Argument> (Argument) throws -> ()'}}
|
||||
mutating func recordArgument<Argument: SomeProtocol>(_ argument: Argument) throws {} // BAD
|
||||
mutating func recordReturnType<R: SerializationRequirement>(_ type: R.Type) throws {}
|
||||
mutating func recordErrorType<E: Error>(_ type: E.Type) throws {}
|
||||
mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
struct FakeInvocationEncoder_missing_recordReturnType: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_missing_recordReturnType: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_missing_recordReturnType' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_missing_recordReturnType' is missing witness for protocol requirement 'recordReturnType'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
@@ -714,32 +728,34 @@ struct FakeInvocationEncoder_missing_recordErrorType: DistributedTargetInvocatio
|
||||
mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
struct FakeInvocationEncoder_recordArgument_wrongType: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_recordArgument_wrongType: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_recordArgument_wrongType' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_recordArgument_wrongType' is missing witness for protocol requirement 'recordArgument'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
|
||||
mutating func recordGenericSubstitution<T>(_ type: T.Type) throws {}
|
||||
mutating func recordArgument<Argument: SerializationRequirement>(_ argument: String, other: Argument) throws {} // BAD
|
||||
// expected-note@+1 {{candidate has non-matching type '<Argument> (Argument.Type) throws -> ()'}}
|
||||
mutating func recordArgument<Argument: SerializationRequirement>(_ argument: Argument.Type) throws {} // BAD
|
||||
mutating func recordArgument<Argument: SerializationRequirement>(badName: Argument) throws {} // BAD
|
||||
mutating func recordReturnType<R: SerializationRequirement>(_ type: R.Type) throws {}
|
||||
mutating func recordErrorType<E: Error>(_ type: E.Type) throws {}
|
||||
mutating func doneRecording() throws {}
|
||||
}
|
||||
struct FakeInvocationEncoder_recordArgument_missingMutating: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_recordArgument_missingMutating: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_recordArgument_missingMutating' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_recordArgument_missingMutating' is missing witness for protocol requirement 'recordArgument'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
|
||||
mutating func recordGenericSubstitution<T>(_ type: T.Type) throws {}
|
||||
// expected-note@+1 {{candidate has non-matching type '<Value> (RemoteCallArgument<Value>) throws -> ()'}}
|
||||
func recordArgument<Value: SerializationRequirement>(_ argument: RemoteCallArgument<Value>) throws {}
|
||||
mutating func recordReturnType<R: SerializationRequirement>(_ type: R.Type) throws {}
|
||||
mutating func recordErrorType<E: Error>(_ type: E.Type) throws {}
|
||||
mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
struct FakeInvocationEncoder_recordResultType_wrongType: DistributedTargetInvocationEncoder {
|
||||
struct FakeInvocationEncoder_recordResultType_wrongType: DistributedTargetInvocationEncoder { // expected-error {{type 'FakeInvocationEncoder_recordResultType_wrongType' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
//expected-error@-1{{struct 'FakeInvocationEncoder_recordResultType_wrongType' is missing witness for protocol requirement 'recordReturnType'}}
|
||||
//expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
@@ -747,6 +763,7 @@ struct FakeInvocationEncoder_recordResultType_wrongType: DistributedTargetInvoca
|
||||
mutating func recordGenericSubstitution<T>(_ type: T.Type) throws {}
|
||||
mutating func recordArgument<Value: SerializationRequirement>(_ argument: RemoteCallArgument<Value>) throws {}
|
||||
mutating func recordReturnType<R: SerializationRequirement>(s: String, _ resultType: R.Type) throws {} // BAD
|
||||
// expected-note@+1 {{candidate has non-matching type '<R> (R.Type) throws -> ()'}}
|
||||
mutating func recordReturnType<R: SomeProtocol>(_ resultType: R.Type) throws {} // BAD
|
||||
mutating func recordReturnType<R: SerializationRequirement>(badName: R.Type) throws {} // BAD
|
||||
mutating func recordErrorType<E: Error>(_ type: E.Type) throws {}
|
||||
@@ -808,6 +825,8 @@ public final class PublicFakeInvocationDecoder_badNotPublic: DistributedTargetIn
|
||||
public func decodeGenericSubstitutions() throws -> [Any.Type] { [] }
|
||||
func decodeNextArgument<Argument: SerializationRequirement>() throws -> Argument { fatalError() }
|
||||
// expected-error@-1{{method 'decodeNextArgument()' must be as accessible as its enclosing type because it matches a requirement in protocol 'DistributedTargetInvocationDecoder'}}
|
||||
// expected-error@-2{{method 'decodeNextArgument()' must be declared public because it matches a requirement in public protocol 'DistributedTargetInvocationDecoder'}}
|
||||
// expected-note@-3 {{mark the instance method as 'public' to satisfy the requirement}}
|
||||
func decodeReturnType() throws -> Any.Type? { nil }
|
||||
// expected-error@-1{{method 'decodeReturnType()' must be declared public because it matches a requirement in public protocol 'DistributedTargetInvocationDecoder'}}
|
||||
// expected-note@-2{{mark the instance method as 'public' to satisfy the requirement}}
|
||||
@@ -816,12 +835,13 @@ public final class PublicFakeInvocationDecoder_badNotPublic: DistributedTargetIn
|
||||
// expected-note@-2{{mark the instance method as 'public' to satisfy the requirement}}
|
||||
}
|
||||
|
||||
final class PublicFakeInvocationDecoder_badBadProtoRequirement: DistributedTargetInvocationDecoder {
|
||||
final class PublicFakeInvocationDecoder_badBadProtoRequirement: DistributedTargetInvocationDecoder { // expected-error {{type 'PublicFakeInvocationDecoder_badBadProtoRequirement' does not conform to protocol 'DistributedTargetInvocationDecoder'}}
|
||||
// expected-error@-1{{class 'PublicFakeInvocationDecoder_badBadProtoRequirement' is missing witness for protocol requirement 'decodeNextArgument'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
|
||||
func decodeGenericSubstitutions() throws -> [Any.Type] { [] }
|
||||
// expected-note@+1 {{candidate has non-matching type '<Argument> () throws -> Argument'}}
|
||||
func decodeNextArgument<Argument: SomeProtocol>() throws -> Argument { fatalError() }
|
||||
func decodeReturnType() throws -> Any.Type? { nil }
|
||||
func decodeErrorType() throws -> Any.Type? { nil }
|
||||
@@ -868,7 +888,7 @@ struct LargeSerializationReqFakeInvocationResultHandler: DistributedTargetInvoca
|
||||
}
|
||||
}
|
||||
|
||||
struct BadResultHandler_missingOnReturn: DistributedTargetInvocationResultHandler {
|
||||
struct BadResultHandler_missingOnReturn: DistributedTargetInvocationResultHandler { // expected-error {{type 'BadResultHandler_missingOnReturn' does not conform to protocol 'DistributedTargetInvocationResultHandler'}}
|
||||
// expected-error@-1{{struct 'BadResultHandler_missingOnReturn' is missing witness for protocol requirement 'onReturn'}}
|
||||
// expected-note@-2{{add stubs for conformance}}{{84-84=\nfunc onReturn<Success: SerializationRequirement>(value: Success) async throws {\n <#code#>\n\}\n}}
|
||||
typealias SerializationRequirement = Codable
|
||||
@@ -888,11 +908,12 @@ struct BadResultHandler_missingRequirement: DistributedTargetInvocationResultHan
|
||||
func onThrow<Err: Error>(error: Err) async throws {}
|
||||
}
|
||||
|
||||
struct BadResultHandler_mutatingButShouldNotBe: DistributedTargetInvocationResultHandler {
|
||||
struct BadResultHandler_mutatingButShouldNotBe: DistributedTargetInvocationResultHandler { // expected-error {{type 'BadResultHandler_mutatingButShouldNotBe' does not conform to protocol 'DistributedTargetInvocationResultHandler'}}
|
||||
// expected-error@-1{{struct 'BadResultHandler_mutatingButShouldNotBe' is missing witness for protocol requirement 'onReturn'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = Codable
|
||||
|
||||
// expected-note@+1 {{candidate is marked 'mutating' but protocol does not allow it}}
|
||||
mutating func onReturn<Success: Codable>(value: Success) async throws {} // WRONG: can't be mutating
|
||||
func onReturnVoid() async throws {}
|
||||
func onThrow<Err: Error>(error: Err) async throws {}
|
||||
|
||||
@@ -53,6 +53,7 @@ final class System: DistributedActorSystem {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout System.InvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res' (aka '<Act, Err, Res> (on: Act, target: RemoteCallTarget, invocation: inout ClassInvocationEncoder, throwing: Err.Type, returning: Res.Type) async throws -> Res') [with ResultHandler = <<error type>>]}}
|
||||
func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
@@ -80,7 +81,7 @@ final class System: DistributedActorSystem {
|
||||
}
|
||||
}
|
||||
|
||||
struct ClassInvocationEncoder: DistributedTargetInvocationEncoder {
|
||||
struct ClassInvocationEncoder: DistributedTargetInvocationEncoder { // expected-error {{type 'ClassInvocationEncoder' does not conform to protocol 'DistributedTargetInvocationEncoder'}}
|
||||
// expected-error@-1{{struct 'ClassInvocationEncoder' is missing witness for protocol requirement 'recordArgument'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
// expected-error@-3{{struct 'ClassInvocationEncoder' is missing witness for protocol requirement 'recordReturnType'}}
|
||||
@@ -88,14 +89,16 @@ struct ClassInvocationEncoder: DistributedTargetInvocationEncoder {
|
||||
typealias SerializationRequirement = SomeClazz
|
||||
|
||||
public mutating func recordGenericSubstitution<T>(_ type: T.Type) throws {}
|
||||
// expected-note@+1 {{candidate has non-matching type '<Value> (RemoteCallArgument<Value>) throws -> ()'}}
|
||||
public mutating func recordArgument<Value: SerializationRequirement>(
|
||||
_ argument: RemoteCallArgument<Value>) throws {}
|
||||
public mutating func recordErrorType<E: Error>(_ type: E.Type) throws {}
|
||||
// expected-note@+1 {{candidate has non-matching type '<R> (R.Type) throws -> ()'}}
|
||||
public mutating func recordReturnType<R: SerializationRequirement>(_ type: R.Type) throws {}
|
||||
public mutating func doneRecording() throws {}
|
||||
}
|
||||
|
||||
final class ClassInvocationDecoder: DistributedTargetInvocationDecoder {
|
||||
final class ClassInvocationDecoder: DistributedTargetInvocationDecoder { // expected-error {{type 'ClassInvocationDecoder' does not conform to protocol 'DistributedTargetInvocationDecoder'}}
|
||||
// expected-error@-1{{class 'ClassInvocationDecoder' is missing witness for protocol requirement 'decodeNextArgument'}}
|
||||
// expected-note@-2{{add stubs for conformance}}
|
||||
typealias SerializationRequirement = SomeClazz
|
||||
@@ -104,6 +107,7 @@ final class ClassInvocationDecoder: DistributedTargetInvocationDecoder {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
// expected-note@+1 {{candidate has non-matching type '<Argument> () throws -> Argument'}}
|
||||
public func decodeNextArgument<Argument: SerializationRequirement>() throws -> Argument {
|
||||
fatalError()
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ public struct FakeActorSystem: DistributedActorSystem {
|
||||
.init()
|
||||
}
|
||||
|
||||
func remoteCall<Act, Err, Res>(
|
||||
public func remoteCall<Act, Err, Res>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
invocation invocationEncoder: inout InvocationEncoder,
|
||||
@@ -97,7 +97,7 @@ public struct FakeActorSystem: DistributedActorSystem {
|
||||
return "<REMOTE CALL>" as! Res
|
||||
}
|
||||
|
||||
func remoteCallVoid<Act, Err>(
|
||||
public func remoteCallVoid<Act, Err>(
|
||||
on actor: Act,
|
||||
target: RemoteCallTarget,
|
||||
invocation invocationEncoder: inout InvocationEncoder,
|
||||
|
||||
Reference in New Issue
Block a user