Swift: Unable to select which names to import from a module

Originator:jeremyw.sherman
Number:rdar://17663511 Date Originated:14-Jul-2014 12:49 PM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification:Serious Bug Reproducible:Always
 
Summary:
Access control has 2 sides:

- What do I export
- What do I import

private/public/protected support the provider's access control needs, but not the client's.

This is especially important for operators, which we cannot disambiguate, and are always top-level scope-clutterers.

Being able to do:

import AutoLayoutHelper hiding (+=, +, -)

which would pull in all exported names expect those mentioned

or:

import (Builder) from AutoLayoutHelper

which would pull in only the mentioned names, or a combo:

import (Builder) from AutoLayoutHelper except (Builder.Unidirectional)

would be very helpful in controlling what's in scope, especially as splitting code into modules using Xcode right now seems to require heavyweight methods (vs. just wrapping some decls in `module X; … endmodule X;`).

Steps to Reproduce:
1. Import a framework but only want one or two names from it.

Expected Results:
2. Restrict the imported names to those names.

Actual Results:
2. Too bad, you get the whole lot.

Version:
Xcode 6.0
Build version 6A254o

ProductName:	Mac OS X
ProductVersion:	10.9.4
BuildVersion:	13E28

Swift version 1.0 (swift-600.0.38.7)
Target: x86_64-apple-darwin13.3.0


Notes:


Configuration:


Attachments:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!