[swift-evolution] SE-0025: Scoped Access Level, next steps

Haravikk swift-evolution at haravikk.me
Wed Mar 16 06:15:36 CDT 2016


> On 16 Mar 2016, at 11:04, Ross O'Brien <narrativium+swift at gmail.com> wrote:
> 
> If this is the case then this would seem clunky:
> @testable(private(scope)) import ModuleName

Does the parameter for @testable need to match exactly? An alternative could be to take it as @testable(private: scope), not quite as clunky but keeps the same basic structure of all restricted accessibility being “private” followed by a type of privacy.

I think that use of a modifier for private(scope) type declarations is the best way to go for avoiding introducing new keywords (actually it would free up internal). It’s actually a style that I’d like to see more of; there was discussion recently about introducing customisable property behaviours, but there was difficulty about how to apply them, however a behaviour(lazy) type syntax could solve that.

When it comes to parsing though, I think that it as long as let/var is required to be the last element before a property name then this eliminates most parsing issues regarding name collisions with properties.


More information about the swift-evolution mailing list