The examples I've seen of module stability always present a scenario where you compile a swift library with a version of Swift, and then the consumer of that library is free to use a later version of the Swift compiler than what your library was compiled with. For example: You compile a framework with Xcode 11.7 (Swift 5.2.4) w/ ABI and module stability, and then give it to another developer who is using Xcode 12.4 (Swift 5.3.2) and they can use it because module stability provides compatibility with future swift compilers.
I'm interested in backwards compatibility of libraries built with module stability. If I build my library in Xcode 12.4 (Swift 5.3.2), can I guarantee that it will work in an app compiled with Xcode 11.7 (Swift 5.2.4)? Or will I, as the library author, always need to build with a <= version of the Swift compiler than my consumers?
I can't seem to find documentation on this, but if there is any I'd appreciate a link to it.
- The WWDC video "Binary Frameworks in Swift" (Binary Frameworks in Swift - WWDC 2019 - Videos - Apple Developer) uses kind-of vague language like
Compatible across compiler versions
Which makes it seem like you could, but in the talk he says
And since they behave like source code, then future versions of the Swift Compiler will be able to import module interfaces created with older versions
- Harlan seems to indicate that swift interface files are not necessarily backwards-compatible here: Can't use framework compiled with Swift 5.2 in Swift 5.1.3 project - #9 by harlanhaskins
Because of these I think the answer is that there are no backwards-compatibility guarantees, but I wasn't completely sure.