Skip to content

The capture sink is an environment key rather than an @Entry - #28

Merged
3lvis merged 1 commit into
mainfrom
fix/capture-sink-environment-key
Sep 15, 2026
Merged

3lvis merged 1 commit into
mainfrom
fix/capture-sink-environment-key

Conversation

@3lvis

@3lvis 3lvis commented Sep 15, 2026

Copy link
Copy Markdown
Owner

The warnings gate fails the build on any first-party warning, and Xcode 27 emits one that #27 did not carry a fix for:

PinCaptureLayout.swift:32:32: warning: Storing a closure in '@Entry var pinCaptureSink' may
invalidate dependents on every update because closures may not be comparable. (from macro 'Entry')

The sink is installed once at the app root, so there is nothing to compare and nothing to gain from making it comparable. Writing the environment key the pre-macro way keeps the same public \.pinCaptureSink and drops the warning — no new type, no change for anyone reading or setting it.

Verified on Xcode 27.0 (27A266a): an uncached xcodebuild build of the Demo scheme emits zero warnings, first-party or otherwise, and both tiers pass on an iOS 27 simulator — unit 213/213, hosted 16/16.

Worth recording why #27 missed it: the local warnings check ran against a warm build directory, so unchanged files never recompiled and the warning never re-emitted. The gate builds uncached for exactly this reason, and that is the only way to check it locally too.

Swift 6.4's @entry macro warns that a closure it stores may invalidate
dependents on every update, since closures are not comparable — and the
warnings gate fails the build on any first-party warning. The sink is installed
once at the app root, so there is nothing to compare and nothing to gain from
making it comparable; the pre-macro spelling carries the same public
\.pinCaptureSink without the warning.

Tests: unit 213/213 + hosted 16/16 green (local xcodebuild)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant