[Pitch] Access-level on import statements

This is a fantastic proposal and I'm thrilled to see it.

As others have noted, making the default access level internal in Swift 6 is a great idea. Can that "Future direction" section move into the proposal itself? Additionally, I'd like for this to get an upcoming feature flag (e.g., InternalImports) so that we can enable this behavior with -enable-upcoming-feature for existing code.

In practice, there are leaks allowing use of extension members from transitive dependencies.

I would love for us to plug these leaks; they're unprincipled and cause problems in practice.

Doug

19 Likes

Yes I'll move it over. The response has been only positive, I expected it to cause more debates.

That makes sense, and it looks like it will clean up the implementation a bit. I'll add it as soon as we have a proposal number to attach to it.

The Swift 6 transition is a good opportunity to fix them as the fix may be source breaking.

4 Likes