In pure Swift 6 projects (when test target swift language version is set to 6) the generated mocks will fail to compile.
Even when I change Swift language version to 5 in test target, there is still some compile errors when in the code there is a class confirming to a generic protocol, for example.
internal protocol GlobalParameters: Sendable {}
internal protocol ParametersValidating {
associatedtype Parameters: GlobalParameters
func validate(parameters: Parameters) throws
}
internal struct SomeParameters: GlobalParameters {
let someProperty: String
}
enum SomeError: Error {
case global
}
internal class SomeParametersValidator: ParametersValidating {
func validate(parameters: SomeParameters) throws {
guard !parameters.someProperty.isEmpty else {
throw SomeError.global
}
}
}
The screenshot of generated mock file can be found in attachment.

In pure Swift 6 projects (when test target swift language version is set to 6) the generated mocks will fail to compile.
Even when I change Swift language version to 5 in test target, there is still some compile errors when in the code there is a class confirming to a generic protocol, for example.
The screenshot of generated mock file can be found in attachment.