-
Notifications
You must be signed in to change notification settings - Fork 205
Description
Description
In MacOS 14, the userInfo
property in the protocols mentoned above has the type [CodingUserInfoKey : Any]
. However, on MacOS 15, this is changed to [CodingUserInfoKey : any Sendable]
. The documentation doesn't disclose any changes to the api over time, just shows the any Sendable
version.
This change is particularly nasty because it appears when upgrading operating systems without changing the Package.swift's platforms entry from .macOS(.v14)
to .macOS(.v15)
, so some colleagues who have a newer laptop cannot compile our code, but those on earlier macOS versions can.
We would be also happy to migrate to the latest API, but that doesn't work on Linux and Windows using Swift 6.1. However, it is consistent and works using Swift 6.2.
Reproduction
Swift 6.1 reproduction of problem: https://godbolt.org/z/cEbfbz1x7
Same code using 6.2 works: https://godbolt.org/z/K5Wdzed7e
Expected behavior
- Have
userInfo: [CodingUserInfoKey : Any]
iff macos version in Package.swift<= 14 - Have
userInfo: [CodingUserInfoKey : any Sendable]
iff macos version in Package.swift >= 15
Environment
My local installation on Windows where it's inconsistent with macos 15:
Swift version 6.1.2 (swift-6.1.2-RELEASE)
Target: x86_64-unknown-windows-msvc
My linux installation in a devcontainer where it's also inconsistent with macos 15:
Swift version 6.1.2 (swift-6.1.2-RELEASE)
Target: x86_64-unknown-linux-gnu
Additional information
FoundationEssentials.swiftinterface.txt
Let me know if there is any additional information needed. The issue presents itself as the FoundationEssentials.swiftinterface containing the old Any
version on Windows and Linux, so I attached the swiftinterface file.