I am developing a binary SDK for consumption by others. When we updated to Xcode 26, any builds which are generated cannot be consumed by Xcode 16.
The specifics lie in the optionals. The following Swift code generate a .swiftmodule
func affectedApi() -> Int? { return 1 }
In Xcode 16 it generated the following .swiftmodule in the framework.
public func affectedIntApi() -> Swift.Int?
In Xcode 26 it adds an "if" statement.
#if compiler(>=5.3) && $NonescapableTypes
public func affectedIntApi() -> Swift.Int?
#endif
That if statement prevents Xcode16 from seeing the API, and it causes compile failures. This happens regardless of which Swift version is used, and it only affects functions which use Optionals.
Is there a way to prevent the compiler from wrapping the API in that statement?