Skip to content

Invalid "sending" keyword in FirebaseDataEncoder.encode – causes Swift compile error #15029

Closed
@AntonioLambertTech

Description

@AntonioLambertTech

Description

Issue Summary

There is a compile-time error in FirebaseDataEncoder.swift in the encode<T: Encodable>(_:) method. The method uses throws -> sending Any, which is invalid in Swift. The sending keyword does not exist in Swift language.

This appears to be a copy-paste or templating mistake in the source file, likely from internal Swift development code.

Steps to Reproduce

  1. Add Firebase via Swift Package Manager
  2. Attempt to build a Swift project that uses Firebase
  3. You will receive:

Reproducing the issue

Suggested Fix

Change the function signature from:

open func encode<T : Encodable>(_ value: T) throws -> sending Any
...

to  open func encode<T : Encodable>(_ value: T) throws -> Any


### Firebase SDK Version

11.5

### Xcode Version

Swift 5.9 / 5.10 (Xcode 15.x)

### Installation Method

Swift Package Manager

### Firebase Product(s)

All

### Targeted Platforms

iOS

### Relevant Log Output

```shell

If using Swift Package Manager, the project's Package.resolved

Expand Package.resolved snippet
Replace this line with the contents of your Package.resolved.

If using CocoaPods, the project's Podfile.lock

Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions