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

Property cannot be declared public because its type uses an internal type #292

Closed
andyryan opened this issue May 30, 2019 · 2 comments · Fixed by #293
Closed

Property cannot be declared public because its type uses an internal type #292

andyryan opened this issue May 30, 2019 · 2 comments · Fixed by #293
Labels
bug PR submitted Used for issues with PR submitted that should contain the fix.

Comments

@andyryan
Copy link

Since updating to the latest version, I am getting build errors in GeneratedMocks due to type accessibility that wasn't an issue before.

For example

I have the following public class

public class client {
    internal var delegates: [ClientDelegate]
}

class [ClientDelegate] {

}

However, cuckoo is trying to make the delegates var public:

public override var delegates: [ClientDelegate] {
        get {
            return cuckoo_manager.getter("delegates",
                superclassCall:
                    
                    super.delegates
                    ,
                defaultCall: __defaultImplStub!.delegates)
        }
        
        set {
            cuckoo_manager.setter("delegates",
                value: newValue,
                superclassCall:
                    
                    super.delegates = newValue
                    ,
                defaultCall: __defaultImplStub!.delegates = newValue)
        }
        
    }

We do not want to make ClientDelegate a public class (this is a framework we are building) and we need the var to be internal so its value can easily be queried by tests.

I see in the release notes this seems to be deliberate behaviour. Why is cuckoo making an internal var public? is there a workaround for this. I can't downgrade as i require generics support at this point

@MatyasKriz
Copy link
Collaborator

Hey, I just tested that issue again because of which I implemented this accessibility inheritance, but it works even without the inheritance. I'm not sure if I failed to test it properly before, but I'll revert the accessibility inheriting and add your use case to the tests so that we avoid this bug in the future.

Thanks for the report!

@MatyasKriz MatyasKriz added the PR submitted Used for issues with PR submitted that should contain the fix. label May 30, 2019
@andyryan
Copy link
Author

👍 Thanks for the quick response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PR submitted Used for issues with PR submitted that should contain the fix.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants