Skip to content

Protocols with protocol conformance not respected in generated mocks #560

@aim2120

Description

@aim2120

I am currently unable to generate mocks for protocols with protocol conformances. Cuckoo claims to support "inheritance (grandparent methods)", but it seems this may not apply to protocols? It's not entirely clear to me whether this is a supported feature or not. Either way, it would be a desirable feature for Cuckoo to have.

Code snippet of offending code:

protocol ParentProtocol {
    func parentFunction()
}

protocol ChildProtocol: ParentProtocol {
    func childFunction()
}

In mocks generated for the above, the MockChildProtocol fails to build due to not satisfying requirements for ParentProtocol.

I've created an example Swift package here with full repro information and example code: https://github.com/aim2120/CuckooProtocolInheritanceExample

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