Skip to content

Parent protocol with associated type cannot be mocked #576

@vinczea

Description

@vinczea

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions