[swift-evolution] Type-based ‘private’ access within a file

BJ Homer bjhomer at gmail.com
Fri Apr 7 10:32:54 CDT 2017

> On Apr 7, 2017, at 9:23 AM, Matthew Johnson <matthew at anandabits.com> wrote:
> The most common thing is to have some stored properties that are private and include a handful of fileprivate (or higher) methods that operate on these properties in the type declaration.  All members that don’t need direct access to these properties are placed in extensions specifically to prevent the direct access to stored properties which they don’t need.  This minimizes the lines of code with access to such properties.

Is there a reason this could not be implemented by putting all the sensitive stored properties in a separate type from the rest of the code?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170407/3a6fff5b/attachment.html>

More information about the swift-evolution mailing list