[swift-evolution] [Discussion] A Problem With SE-0025?

Matthew Johnson matthew at anandabits.com
Wed Jun 29 08:11:23 CDT 2016


There is nothing preventing you from using fileprivate if you want to write your code in this style.  At most you can complain that you don't like the new keyword.  But you're not losing any functionality so I don't understand why you say you are "missing" something.

Sent from my iPad

> On Jun 29, 2016, at 1:25 AM, David Hart via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
>> On 29 Jun 2016, at 04:03, Matthew Judge <matthew.judge at gmail.com> wrote:
>> 
>> If I understand SE-0025 (even with the amendment) you can still spell the access modifier to types as 'private' and get the same characteristics as the pre-SE-0025 meaning or private, so I'm not sure I understand the concern here. However (continued below)
> 
> The characteristic I will be missing is for the following style of writing:
> 
> class MyViewController : UIViewController {
>     private var privateInfo: String?
> }
> 
> //MARK: Public
> 
> public extension MyViewController {
>     func publicFunction() {
>         // CAN’T ACCESS privateInfo
>     }
> }
> 
> //MARK: UITableViewDataSource
> 
> private extension MyViewController : UITableViewDataSource {
>     func numberOfRowsInSection(_ section: Int) -> Int
>         // CAN’T ACCESS privateInfo
>     }
> }
> 
> //MARK: Private
> 
> private extension MyViewController {
>     func implementationFunction() {
>         // CAN’T ACCESS privateInfo
>     }
> }
> _______________________________________________
> 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/20160629/91c7d903/attachment.html>


More information about the swift-evolution mailing list