[swift-evolution] Swift evolution proposal: introduce typeprivate access control level

Tino Heth 2th at gmx.de
Thu Dec 1 04:22:21 CST 2016


> - Typeprivate would allow to abandon the odd fileprivate. Access level would be constrained to swift constructs (structs, classes and extensions) and not to a compiler artifact (file).
Actually, imho fileprivate isn't odd or "unswift"* — it's one of the three original levels, which all rely on the layout of the filesystem ("same file?" and "same folder/module?").
Even if there was a change of mind, fileprivate is still needed for essential things like implementing Equatable.

But I'm not arguing against typeprivate at all (nor against access control in general ;-)

- Tino

* I tend not to use attributes like "swifty"… most of the time, it just means "I think this is the right choice"


More information about the swift-evolution mailing list