[swift-evolution] Protected access level / multiple class/struct/protocol APIs
2th at gmx.de
Tue Mar 29 03:55:21 CDT 2016
A more sophisticated rights system isn't necessary, but actually, we could build everything with nothing but "public", so it is always a compromise between simplicity and expressiveness…
Imho it would be nice to be able to mark a method that is only there to be overridden and should never be called directly, but I don't think the compiler has to enforce this:
An official way to document the intent that affects autocompletion would be sufficient for me.
Besides the question where (class/module/public…) something is visible, there is also the question of what can or has to be done with a method:
- callable (read for properties)
- can override, call to super enforced
- can override
- has to be overridden (abstract)
- properties only: Write access
If there is an elegant way to handle all use cases, I'd strongly support this direction.
More information about the swift-evolution