From 05f3abc6623a00ec906c34090db6557790a17a32 Mon Sep 17 00:00:00 2001 From: Functionhx <172989722+Functionhx@users.noreply.github.com> Date: Fri, 2 Oct 2026 22:07:56 -0700 Subject: [PATCH] Fix synthesizer selection for older Swift compilers The mixed-type nil-coalescing compiled on Xcode 27 but not on the CI toolchain. Co-Authored-By: Claude Opus 5.5 --- WriteBench/Features/Writing/WritingStore.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/WriteBench/Features/Writing/WritingStore.swift b/WriteBench/Features/Writing/WritingStore.swift index 4266265..4f9159f 100644 --- a/WriteBench/Features/Writing/WritingStore.swift +++ b/WriteBench/Features/Writing/WritingStore.swift @@ -149,7 +149,10 @@ enum WritingStage { case preparation, answering } detail: "\(judges) · ChatGPT via Codex\n\(error.localizedDescription)\n尚未发起评卷,请在设置中检查连接。") } } - let synthesizer: (any ReportSynthesizer)? = configuration.synthesize && configuration.mode == .full ? (selectedDeepSeek ?? codex) : nil + var synthesizer: (any ReportSynthesizer)? + if configuration.synthesize, configuration.mode == .full { + if let selectedDeepSeek { synthesizer = selectedDeepSeek } else if let codex { synthesizer = codex } + } return (ProviderRouter(configuration: configuration, deepSeek: selectedDeepSeek, codex: codex), synthesizer) } }