Cuckoo
Cuckoo copied to clipboard
Parent protocol with associated type cannot be mocked
Given the following file:
import Foundation
public enum CustomError: Error {
}
public protocol Parent<ErrorType> {
associatedtype ErrorType: Error
func doIt()
}
public protocol Child: Parent<CustomError> {
}
Trying to mock Child protocol with latest release (2.1.1) I get the following error:
Type 'MockChild' does not conform to protocol 'Parent'
The generated mock class doesn't implement Parent's protocol doIt function. Of course if there isn't associated type or Child protocol it is working fine.
I see, seems to be a case of missing functionality. Could you please try out some combinations and let me know what needs to change to get the mocks to compile and use the mock as expected?