[Functions] Complete Swift 6 support #14838
Merged
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.
This PR gets Function to complete Swift 6 support.
Note: I did add a TODO in the Functions error handling. In theory, it should be okay, but in practice, it will be hard to get checked Sendable until
FunctionsSerializer
no longer returnsAny
. This appears feasible but it will take some more investigation and I'd prefer to circle back to it to focus on others areas of Swift 6 compliance.Reasoning for changes in
FirebaseFunctions/Sources/HTTPSCallable.swift
:sending
param attribute does not bridge to ObjC. Even passing an immutable type from ObjC crashed the integration tests. To workaround, I'm marking the existing signature ObjC-only and adding a new Swift-only function with thesending
param. It should otherwise match the existing signature and not be a break to Swift 5 clients because Sendability changes are non-breaking. The ObjC-only calls through to it with aSendableWrapper
type that seems to appease the runtime.#no-changelog