Add @unknown default: to Transcript.Entry/Segment switches (macOS 27 SDK compat) - #8
Open
srirsiva wants to merge 1 commit into
Open
Add @unknown default: to Transcript.Entry/Segment switches (macOS 27 SDK compat)#8srirsiva wants to merge 1 commit into
srirsiva wants to merge 1 commit into
Conversation
… 27 SDK compat)
macOS 27 SDK adds new cases to Transcript.Entry and Transcript.Segment
that are absent from macOS 26 — the two non-exhaustive switches in
FoundationModelsFrameworkPlugin.swift compile with warnings on macOS 26
but fail as errors on macOS 27 ("switch must be exhaustive"), breaking
every fresh macOS build.
Adds @unknown default: to both switches on iOS and macOS. The same file
already uses this pattern for SystemLanguageModel.Availability.
UnavailableReason (lines 392, 406) — this just extends the pattern to
the other two frozen-but-actually-evolving Apple enums so future SDK
additions won't break the build again.
- Transcript.Entry unknown case → role="unknown", content/segments =
String(describing: entry) so the transcript stays lossless.
- Transcript.Segment unknown case → String(describing: segment), same
intent.
iOS 27 SDK doesn't add new cases (yet), so iOS builds fine either way;
patching both platforms for forward-compat symmetry.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Problem
macOS 27 SDK adds new cases to
Transcript.EntryandTranscript.Segmentthat aren't present in macOS 26. The two non-exhaustive switches inFoundationModelsFrameworkPlugin.swiftcompile with warnings on macOS 26 but fail as hard errors on macOS 27, blocking every fresh macOS build:Fix
Adds
@unknown default:to both switches on iOS and macOS. The same file already uses this pattern forSystemLanguageModel.Availability.UnavailableReason(lines 392, 406) — this just extends the pattern to the other two Apple enums so future SDK additions don't break the build again.Defaults:
Transcript.Entryunknown case →role = "unknown",contentandsegments = String(describing: entry)so the transcript stays lossless.Transcript.Segmentunknown case →String(describing: segment), same intent.Platforms
Verified locally by building a real macOS Flutter target (
flutter build macos --release) against Xcode 27 / macOSX27.0.sdk — build now succeeds.🤖 Generated with Claude Code