Thank you

> On Jul 1, 2016, at 4:24 PM, Chris Lattner <[email protected]> wrote:
> 
> 
>> On Jul 1, 2016, at 4:09 AM, Daniel Steinberg via swift-evolution 
>> <[email protected]> wrote:
>> 
>> My apologies if this was resolved before. 
>> 
>> At one point there was a suggestion for the access level for the 
>> auto-generated init for structs. The issue was that the access level is 
>> internal by default. If you want to make this init public you have to 
>> implement the init yourself - there is no syntax for marking the default 
>> init as public.
>> 
>> Also, as in many other languages, if you implement your own init  the 
>> default init is not generated. There are times when you want this to be 
>> generated anyway so that other inits might call through it. Perhaps to set 
>> default values without having to reimplement this init.
>> 
>> Finally, in this last case you might want the default init generated but not 
>> exposed to the module or publicly - you may want to mark it as fileprivate 
>> but expose another init that uses it.
> 
> This topic has definitely come up, culiminating in this proposal:
> https://github.com/apple/swift-evolution/blob/master/proposals/0018-flexible-memberwise-initialization.md
> 
> I expect this to come up again after Swift 3 is done,
> 
> -Chris

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to