Skip to content

Fix Swift 6 strict-concurrency warnings in InputSystem+Keyboard's text-focus check - #1428

Merged
untoldengine merged 1 commit into
developfrom
fix/swift6-guardrail-firstresponder-isolation
Dec 1, 2026
Merged

untoldengine merged 1 commit into
developfrom
fix/swift6-guardrail-firstresponder-isolation

Conversation

@untoldengine

Copy link
Copy Markdown
Owner

Summary

Test plan

  • swift build passes
  • swift build -Xswiftc -strict-concurrency=complete -Xswiftc -warn-concurrency (the guardrail's exact build) produces zero warnings in this file
  • make format — no additional reformatting beyond the intended change

…t-focus check

PR #1424 added a synchronous NSApp.keyWindow?.firstResponder check inside
shouldHandleKey, a plain nonisolated instance method, producing 3 strict-
concurrency warnings (NSApp, keyWindow, firstResponder are all MainActor-
isolated). The swift6-guardrails CI check has a zero-warning budget, so
this blocks every PR built off develop until fixed.

shouldHandleKey is only ever called from an NSEvent local monitor handler,
which AppKit always invokes on the main thread, so the isolation is
genuinely held at runtime -- MainActor.assumeIsolated proves that to the
compiler without marking the whole type @mainactor or threading async
through its two call sites.
@untoldengine
untoldengine merged commit 5d81e9e into develop Dec 1, 2026
3 of 4 checks passed
@untoldengine
untoldengine deleted the fix/swift6-guardrail-firstresponder-isolation branch December 1, 2026 15:44
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