Replies: 1 comment 1 reply
-
Hi @grennis, the initializer is as public as the non-defaulted fields it holds onto. So this will generate a public initializer: @DependencyClient
public struct TestClient {
public var foo: () -> Void
} You can see this in action in some of our macro tests starting here. To us this makes the most sense because why would you want to publicly be able to configure a closure that cannot be publicly invoked? Since this isn't an issue with the library I am going to convert it to a discussion. Please feel free to continue the conversation over there! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
The documentation states that the @DependencyClient macro "generates a public initializer... This is particularly useful when modularizing your dependencies... as you will need a public initializer to create instances of the client", however, the generated initializer is not public.
Checklist
main
branch of this package.Expected behavior
Given this
I expect to generate
Actual behavior
Generated code is:
Steps to reproduce
Please see example above.
Dependencies version information
1.6.3 (tested main branch also)
Destination operating system
iOS 18
Xcode version information
16.2
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions