[swift-evolution] access control

Jordan Rose jordan_rose at apple.com
Mon Jan 25 18:04:14 CST 2016


Let's please keep "protected" on a separate thread. Adding "protected" and adding "local" are pretty much completely orthogonal.

Jordan


> On Jan 25, 2016, at 14:19, Haravikk via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Just to add my thoughts to this increasingly convoluted thread, but while I agree that the way that private works right now is fine for most purposes, I would also like to see a Java style protected option as well for many of the reasons mentioned, but most importantly that it allows me to define an abstract or sub-classable type in one file, and have it sub-classed elsewhere without having to expose internal, sub-class only, methods to everything else.
> 
> That said, in Swift the ability to put actual code in extensions largely eliminates the need for abstract classes, which cuts down on quite a lot of necessary sub-classing, at least in my experience. But still, private isn’t ideal for keep sub-class only methods hidden; keeping stuff like that hidden is nice purely from a clutter/auto-complete perspective, let alone the requirement it puts on teams to have a naming convention for sub-class oriented methods._______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list