[swift-evolution] [swift-evolution-announce] [Review] SE-0159: Fix Private Access Levels

Drew Crawford drew at sealedabstract.com
Thu Mar 23 16:01:00 CDT 2017

On March 23, 2017 at 12:32:38 PM, Brent Royal-Gordon (brent at architechies.com) wrote:

To what extent could your need for safety be satisfied by (a) giving the property a long, unique name like `unsafeUnsynchronizedT`, and (b) writing a very small unit test/shell script/Perl script which makes sure references to that very unique name only appear between the two "MARK:" comments?
A third-party linter to get a scoped feature is our current candidate for reimplementing this feature if it's dropped from Swift.

However, I think it's worth asking to what extent it makes sense to build a language that gets fixed with linters.  For example Swift could have used a linter for typechecking (Python is doing this) but the benefits of compile-time typechecking affect a large number of programs and so we decided to ship with batteries included.

The scoped visibility is like the type system.  It is a compile-time check that is used to catch threading, information disclosure, encapsulation violation, or similar bugs.  These are problems that affect a large number of programs, we should ship with batteries included.

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

More information about the swift-evolution mailing list