fix(build): qualify InterlinedDomain.Document so the app compiles on Xcode 27 - #99
Merged
Merged
Conversation
…Xcode 27
`dev` stopped building when Xcode was updated on this machine mid-session. The
macOS 27 SDK adds a `Document` protocol to SwiftUI —
public protocol Document: ReadableDocument, WritableDocument
— which collides with the domain's `Document` struct in any file importing both.
That is every documents-feature view, and the same unchanged source went from
compiling to eleven `'Document' is ambiguous for type lookup` errors across eight
files.
Only the SwiftUI-importing files are affected, which is what makes the diagnosis
unambiguous: the view models import Foundation, Observation and InterlinedDomain
but not SwiftUI, and they compile untouched.
The fix is to qualify the type at the use sites. Three alternatives were
considered and rejected. Renaming the domain model is the tail wagging the dog —
`Document` is the right name, and it is correct across Kit, Domain, Persistence
and their tests. A module-level typealias would shorten the use sites at the cost
of giving one concept two names, so the next reader has to learn they are the
same thing. Dropping `import SwiftUI` is not available; these are views.
Every edit is a type position. No user-facing string, accessibility label or
other identifier containing the word Document is touched — the diff is eleven
lines, each one a `Document` that the compiler itself pointed at.
Worth knowing rather than fixing: this is a standing hazard. Any domain type
sharing a name with a SwiftUI symbol is one SDK update away from the same break,
and the diagnosis is written down at the top of DocumentsListView so the next
occurrence takes minutes.
Refs #98
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 16, 2026
Merged
Member
Author
|
This was referenced Sep 16, 2026
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.
Summary
Closes #98. Merge this first —
devdoes not compile without it, so every other open PR is blocked behind it.What happened
Xcode was updated on this machine at 12:23 today, mid-session. Builds from the same commit succeeded before it and failed after. The macOS 27 SDK adds a
Documentprotocol to SwiftUI:InterlinedDomainhas exported aDocumentstruct since M4. Any file importing both now has an ambiguousDocumentin scope — and that is every documents-feature view.Eleven errors across eight files, all
App/Features/**:The last two only surfaced once the earlier ones stopped short-circuiting compilation, which is why the first error list was nine.
The view models are unaffected, and that is what makes the diagnosis unambiguous: they import Foundation, Observation and
InterlinedDomainbut not SwiftUI, and they compile untouched. It is exactly the SwiftUI-importing files.The fix
Qualify the type at the use sites:
InterlinedDomain.Document.Every edit is a type position. No user-facing string, accessibility label, or other identifier containing the word "Document" is touched — the diff is eleven lines, each one a
Documentthe compiler itself pointed at. The full diff is in the Files tab and is worth a glance precisely because a blanket find-and-replace here would have been wrong.Rejected alternatives
Documentis the right name for it, and it is correct across Kit, Domain, Persistence and their tests. Renaming a core model to dodge a collision in one consumer is the tail wagging the dog.typealias ILDocumentimport SwiftUIOne explanatory note goes at the top of
DocumentsListView.swiftrather than eleven copies of the same paragraph.Worth knowing
This is a standing hazard, not a one-off. Any domain type sharing a name with a SwiftUI symbol is one SDK update away from the same break. Nothing to do pre-emptively — but the diagnosis is now written down, so the next occurrence takes minutes rather than an afternoon.
Verification
On Xcode 27.0 (27A266a), macOS SDK 27.0:
xcodebuild build→** BUILD SUCCEEDED **xcodebuild test(App) →Executed 968 tests, with 0 failures·** TEST SUCCEEDED **swift test InterlinedDomain→Executed 1012 tests, with 0 failuresswift test InterlinedPersistence→Executed 140 tests, with 0 failuresswift test InterlinedKit --skip ContractTests→Executed 477 tests, with 0 failures(liveContractTestsrate-limited from this session's recon; unmodified here)No behaviour change — this is a compile fix.
Note for the other open PRs
#86, #87, #88, #89, #90, #92, #93, #94, #96 and #97 all branch from
devbefore this. Their gates were run before the Xcode update and were green at the time. Once this merges they will each needdevmerged in to build on Xcode 27; nothing about their content is affected.🤖 Generated with Claude Code