[swift-evolution] [Draft] scope-based submodules

Brent Royal-Gordon brent at architechies.com
Sun Mar 5 15:04:29 CST 2017

> On Mar 3, 2017, at 12:56 PM, Matthew Johnson <matthew at anandabits.com> wrote:
>> Outside the `WorldOptimization` module, of course, you'd still need to write `import WorldOptimization.SpimsterWicket` to get access to the `WicketShell` type. (Or perhaps importing `WorldOptimization` would allow you to access it as `SpimsterWicket.WicketShell`--it's an open question.) On the other hand, if `WorldOptimization` instead included:
>> 	@exported import WorldOptimization.SpimsterWicket
>> 	class Optimizer: Person {
>> 		var wicketShell: WicketShell?
>>>> 	}
>> Then anyone who imported `WorldOptimization` could access `WicketShell` directly, as though they too had explicitly imported `WorldOptimization.SpimsterWicket`.
> If I understand correctly, this does not change the fully qualified name seen by users of the module, only sets up an implicit import of the submodule when the module is imported.  Is that correct?


Brent Royal-Gordon

More information about the swift-evolution mailing list