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

Generated code does not follow the enclosing class access control #42

Open
GustavoVergara opened this issue Oct 15, 2020 · 1 comment
Open

Comments

@GustavoVergara
Copy link

When code is generated it doesn’t set an access control to anything.
This raises a compiler error when both the protocol and the mock class are public/open.

For example, this protocol and class:

public protocol FooProtocol {
    func bar(arg: String) -> Int
}

public class FooSpy: FooProtocol {
    var invokedBar = false
    var invokedBarCount = 0
    var invokedBarParameters: (arg: String, Void)?
    var invokedBarParametersList = [(arg: String, Void)]()
    var stubbedBarResult: Int! = 0

    func bar(arg: String) -> Int {
        invokedBar = true
        invokedBarCount += 1
        invokedBarParameters = (arg, ())
        invokedBarParametersList.append((arg, ()))
        return stubbedBarResult
    }
}

Raises the error:
image

@seanhenry
Copy link
Owner

Hi @GustavoVergara

Thanks for raising this issue. This feature hasn't been implemented yet but I will add it in the next release.

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

2 participants