[swift-evolution] [Proposal][Discussion] Modular Swift

Robert Widmann devteam.codafi at gmail.com
Tue Feb 21 21:14:57 CST 2017

Fileprivate and private are not changing at all.  Their meaning now extends from “private to this file” and “private to this declaration” respectively to those meanings plus “unexportable across any module boundary”.  One implication of this is it is now possible to create module-scoped private constants, functions, and data structures, which is one of the use-cases that Daniel Duan mentioned earlier down in the thread.

> On Feb 21, 2017, at 10:12 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
> So are private and/or fileprivate changing to mean "visible within current submodule"? Because I specified that baz() is in a type extension, possibly in another file. 
> -- 
> Brent Royal-Gordon
> Sent from my iPhone
>> On Feb 21, 2017, at 7:08 PM, Robert Widmann <devteam.codafi at gmail.com> wrote:
>> For baz(), because you wish to be able to
>> 1) Not export it across the outermost module boundary, 
>> 2) Or even your own internal submodule boundary
>> Private or fileprivate suffices depending on the scoping you wish for it to have within the file/interface it’s a part of relative to the other APIs in the submodule.

More information about the swift-evolution mailing list