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

Bugfix: fix accessor for typealias #510

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aim2120
Copy link

@aim2120 aim2120 commented Sep 19, 2024

Description

Bug

If a class had a typealias with an accessor, this value was not used in the mocks generation. This creates build errors if the typealias is used in APIs that require that level of accessor.

public class MyClass {
  public typealias MyValue = String // <- this typealias would be included in the mock w/o a public accessor
  public func doSomething(with value: MyValue) { }
}

Fix

Add the container's accessibility level to each typealias definition in the template.

Testing

I've added a new class for testing ClassWithTypeAlias that prior to the fix would not create a buildable Swift code.

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

Successfully merging this pull request may close these issues.

1 participant