Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't mock protocols that are restricted to specific class adoption #331

Open
mapierce opened this issue Dec 6, 2022 · 0 comments
Open

Comments

@mapierce
Copy link
Contributor

mapierce commented Dec 6, 2022

If I have a protocol like so:

// sourcery: AutoMockable
// sourcery: typealias = "ContentType = NSObject"
protocol CellContentView: UIView {

    associatedtype ContentType
    
    init(content: ContentType)

}

I can't mock it because I get the error in my Mock.swift file:

'CellContentView' requires that 'CellContentViewMock' inherit from 'UIView'

and the declaration of the CellContentViewMock looks like this:

open class CellContentViewMock: CellContentView, Mock {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant