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

Daniel Leping daniel at crossroadlabs.xyz
Thu Dec 1 07:57:36 CST 2016


Let's add "private (ancestors)" on top. As a framework developer I really
miss it.

On Thu, 1 Dec 2016 at 15:34 Tino Heth via swift-evolution <
swift-evolution at swift.org> wrote:

>
> @Tino: Regarding the following statement - "Even if there was a change of
> mind, fileprivate is still needed for essential things like implementing
> Equatable.”
> How exactly is that so? Am I missing something?
>
>
> class Eq: Equatable {
> private var value = 0
> }
>
> func ==(lhs: Eq, rhs: Eq) -> Bool {
> return lhs.value == rhs.value
> }
>
> This doesn't compile — but it works fine when you declare value to be
> fileprivate.
> There are other cases where fileprivate is the best choice, but this is
> quite common (of course, it's always possible to use internal instead… but
> we could as well remove all levels and keep nothing but public)
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161201/3c961ee1/attachment.html>


More information about the swift-evolution mailing list