[swift-evolution] explicitly mark synthesized init as public
bspratling at mac.com
Thu Jul 6 10:17:07 CDT 2017
Often I want to separate my data model into a separate framework from my UI. This enables separation of data and logic tests from UI tests. And sharing a common data model between multiple apps, such as a end-user facing app and a back-of-house app.
I also like to use structs to support simple data models. Merely declaring properties and their types and getting synthesized initializers is great.
But when a struct is declared in one framework and it's init method is called from another, the compiler does not allow access to this synthesized initializer.
Manually retyping the init method is tedious work which it's obvious the compiler already knows how to do.
I suggest we add a way to explicitly mark synthesized init methods as public.
Spell it however we want, perhaps something like this
public init default
public default init
Or maybe just
Would someone like to help me draft a proposal for this?
Sent from my iPhone.
More information about the swift-evolution