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

[Feature Request] mock actor protocols #317

Open
DwayneCoussement opened this issue Jun 9, 2022 · 2 comments
Open

[Feature Request] mock actor protocols #317

DwayneCoussement opened this issue Jun 9, 2022 · 2 comments

Comments

@DwayneCoussement
Copy link

Hi,

We are using actors that implement a protocol and we ran into a problem while generating mocks.

We have the following protocol

protocol AwesomeProtocol: Actor {
   func test()
}

Notice if we generate mocks now, the generated code will be invalid Swift code:

open class AwesomeProtocolMock: AwesomeProtocol, Mock {
///  code for classes
}

Expected in this case would be:

public actor AwesomeProtocolMock: AwesomeProtocol, Mock {
///  code for actors
}

Would be cool to have these features as well.

Dwayne

@choulepoka
Copy link

There is also another use case, if you have a class / method that is annotated with @MainActor, the code gets generated with the annotation, but internal mock code does not support actors, so you get a bunch of errors

@vadimkrutovlv
Copy link

Hi,

Any news on this? It would be really great to get Actor protocol supported.

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

3 participants