mirror of
https://github.com/firebase/firebase-ios-sdk
synced 2026-11-09 22:36:01 +05:45
refactor(ai): gate GLM Entry.data on Swift 6.4.2 (#16910)
Replace `#if canImport(FoundationModels, _version: 2.1)` with `#if compiler(>=6.4.2)` around the `Transcript.Entry.data` case in `GeminiTranscriptTranslator` and its test. Xcode 27.2 beta 3 bumped the Swift compiler to 6.4.2, so the condition no longer depends on the underscored `_version` parameter of `canImport`. Earlier Xcode 27.2 betas report Swift 6.4 and skip the case, which is acceptable since beta 3 supersedes them.
This commit is contained in:
1 parent
89f0174128
commit
c276eca72a
2 files changed
+6
-5
No files matched your search
@@ -152,14 +152,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
// `Transcript.Entry.data` was added in the Xcode 27.2 SDK (FoundationModels 2.1).
|
||||
#if canImport(FoundationModels, _version: 2.1)
|
||||
// `Transcript.Entry.data` was added in Xcode 27.2 (Swift 6.4.2+).
|
||||
#if compiler(>=6.4.2)
|
||||
case .data:
|
||||
throw makeUnsupportedError(
|
||||
entry,
|
||||
description: "Data transcript entries are not supported."
|
||||
)
|
||||
#endif // canImport(FoundationModels, _version: 2.1)
|
||||
#endif // compiler(>=6.4.2)
|
||||
|
||||
@unknown default:
|
||||
throw makeUnsupportedError(
|
||||
|
||||
+3
-2
@@ -675,7 +675,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
#if canImport(FoundationModels, _version: 2.1)
|
||||
// `Transcript.Entry.data` was added in Xcode 27.2 (Swift 6.4.2+).
|
||||
#if compiler(>=6.4.2)
|
||||
@Test
|
||||
@available(macOS 27.2, iOS 27.2, watchOS 27.2, visionOS 27.2, *)
|
||||
@available(tvOS, unavailable)
|
||||
@@ -696,7 +697,7 @@
|
||||
Issue.record("Unexpected error thrown: \(error)")
|
||||
}
|
||||
}
|
||||
#endif // canImport(FoundationModels, _version: 2.1)
|
||||
#endif // compiler(>=6.4.2)
|
||||
|
||||
@Test
|
||||
@available(macOS 27.0, iOS 27.0, watchOS 27.0, visionOS 27.0, *)
|
||||
|
||||
Reference in new issue
Block a user