[swift-evolution] [Swift 4] Organizing source stability

Brent Royal-Gordon brent at architechies.com
Wed Aug 3 03:16:47 CDT 2016


> On Jul 29, 2016, at 5:55 PM, Jacob Bandes-Storch via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 	• a top-of-file "shebang"-style comment indicating the version, something like //#swift(4), mirroring the "#if swift" syntax

`import Swift 3.1`?

I think this brings up two interesting questions:

* Do we want to be able to mix files using different versions of Swift in the same module?
* Do we want to extend these backwards compatibility features beyond the standard library to other modules?

If the answer to both is "yes", then the compiler can just treat the version of the `Swift` module specially, using it to adjust the language syntax in addition to the standard library interface. The command-line switch can be one that provides a default version for imports with unspecified versions, like:

	--version Swift=3.1 --version SomeJSON=1.2

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list