[Pre-Pitch] Import access control: a modest proposal

I approve of any removal of underscore special cases.

But I feel like there are use cases for fileprivate, and open. To me @_exported import feels like an adjustment of visibility of inheritance so it lines up w/ open. public seems quite on par w/ what we have today of normal imports, and internal would be VERY nice to have as @_implementationOnly being that the scope of the internal declaration there is to the module itself. But there are times at which I want to control the scope of types such that they do not leak through implementations and a file private restriction would be welcomed in my book either spelled as fileprivate import or private import ether way feels like something that would be helpful for framework development (especially for those of us who need to work on things that do not expose internal bits to the outside world from our frameworks when it comes to layering or types).

10 Likes