Make AnyType Sendable#788
Merged
Merged
Conversation
ce96c74 to
94891b7
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## player-1-dot-zero #788 +/- ##
=====================================================
- Coverage 85.90% 85.89% -0.01%
=====================================================
Files 507 507
Lines 22891 23104 +213
Branches 2656 2656
=====================================================
+ Hits 19664 19845 +181
- Misses 2898 2930 +32
Partials 329 329 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
KVSRoyal
commented
Feb 4, 2026
tmarmer
approved these changes
Feb 4, 2026
cehan-Chloe
approved these changes
Feb 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Contribution originally by @JJ-Intuit
This is a clone of #782 that is a direct branch of player, rather than a fork. Forks don't run on CI/CD properly.
What
This PR makes the
AnyTypeenum conform to theSendableprotocol by removing allAny-based APIs and using only recursiveAnyTypevalues. This enables safe usage across Swift concurrency boundaries but introduces breaking changes for code that relied onAnyinteroperability.See "Release Notes" for full description. (Moved there to avoid redundancy.)
Why
With Swift 6's strict concurrency checking,
AnyTypeneeded to beSendableto be used safely in concurrent contexts.Change Type (required)
Indicate the type of change your pull request is:
patchminormajorN/A; going into Player 1.0Does your PR have any documentation updates?
Release Notes
Breaking Change:
.anyArrayand.anyDictionaryuseAnyTypeThe
AnyTypeenum now conforms toSendableprotocol and is concurrency-safe. This required removing all APIs that depended on theAnytype:Migration
Use
AnyTypecases directly instead of converting from/toAny:Breaking Change:
AnyTypewill only decode.unknownDatawithAnyTypeDecodingContextUsers are required to provide
AnyTypeDecodingContextwhen attempting to decodeanyArrayoranyDictionary. The decoder will throw if we need the context but one is not provided. As a side effect of this,.unknownDatawill only be returned when a context is provided. For example:Breaking Change:
AnyTypeDecodingContext.objectForis no longerpublic.All decoding of
AnyTypeis now handled internally. SoAnyTypeDecodingContext.objectFor(path: [CodingKey]) throws -> Anyis no longer exposed to users.New Features
Added
as<T>(_:)convenience method andAnyType(anyDictionary) subscripting for type-safe value extraction: