diff --git a/.github/workflows/_cocoapods.yml b/.github/workflows/_cocoapods.yml index 9e8778e2382..4cd280bdd02 100644 --- a/.github/workflows/_cocoapods.yml +++ b/.github/workflows/_cocoapods.yml @@ -124,11 +124,11 @@ jobs: fail-fast: false matrix: os: [macos-15, macos-26] - xcode: [Xcode_16.4, Xcode_26.1] + xcode: [Xcode_16.4, Xcode_26.2] platform: [iOS, tvOS, macOS, watchOS] exclude: - os: macos-15 - xcode: Xcode_26.1 + xcode: Xcode_26.2 - os: macos-26 xcode: Xcode_16.4 include: diff --git a/.github/workflows/_spm.yml b/.github/workflows/_spm.yml index 0b3f510cca5..b8a75e1285f 100644 --- a/.github/workflows/_spm.yml +++ b/.github/workflows/_spm.yml @@ -98,11 +98,11 @@ jobs: fail-fast: false matrix: os: [macos-15, macos-26] - xcode: [Xcode_16.4, Xcode_26.1] + xcode: [Xcode_16.4, Xcode_26.2] platform: [iOS, tvOS, macOS, watchOS, catalyst, visionOS] exclude: - os: macos-15 - xcode: Xcode_26.1 + xcode: Xcode_26.2 - os: macos-26 xcode: Xcode_16.4 include: diff --git a/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift b/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift index d8cec20a203..31b84194908 100644 --- a/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift +++ b/FirebaseCore/Internal/Tests/Unit/HeartbeatStorageTests.swift @@ -64,7 +64,11 @@ class HeartbeatStorageTests: XCTestCase { func testCachedInstancesCannotBeRetainedWeakly() { // Given var strongHeartbeatStorage: HeartbeatStorage? = .getInstance(id: "sparky") - weak var weakHeartbeatStorage: HeartbeatStorage? = .getInstance(id: "sparky") + #if swift(>=6.2) + weak let weakHeartbeatStorage: HeartbeatStorage? = .getInstance(id: "sparky") + #else + weak var weakHeartbeatStorage: HeartbeatStorage? = .getInstance(id: "sparky") + #endif XCTAssert( strongHeartbeatStorage === weakHeartbeatStorage, "Instances should reference the same object." diff --git a/FirebaseStorage/CHANGELOG.md b/FirebaseStorage/CHANGELOG.md index fca3085cc3b..06a94757050 100644 --- a/FirebaseStorage/CHANGELOG.md +++ b/FirebaseStorage/CHANGELOG.md @@ -1,3 +1,6 @@ +# Unreleased +- [fixed] Fix "weak never mutated" build warning introduced in Xcode 26.2. + # 12.0.0 - [removed] **Breaking change**: Removed the following unused API, `StorageMetadata.storageReference`. diff --git a/FirebaseStorage/Sources/StorageReference.swift b/FirebaseStorage/Sources/StorageReference.swift index 26d4b27ee5a..10524cfdaa7 100644 --- a/FirebaseStorage/Sources/StorageReference.swift +++ b/FirebaseStorage/Sources/StorageReference.swift @@ -316,7 +316,11 @@ import Foundation var prefixes = [StorageReference]() var items = [StorageReference]() - weak var weakSelf = self + #if swift(>=6.2) + weak let weakSelf = self + #else + weak var weakSelf = self + #endif var paginatedCompletion: ((_: StorageListResult?, _: Error?) -> Void)? paginatedCompletion = { (_ listResult: StorageListResult?, _ error: Error?) in