Repository navigation
Fix Swift 6 strict-concurrency warnings in InputSystem+Keyboard's text-focus check - #1428
Merged
untoldengine merged 1 commit intoDec 1, 2026
Merged
Conversation
…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
deleted the
fix/swift6-guardrail-firstresponder-isolation
branch
December 1, 2026 15:44
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
swift6-guardrailsCI is currently blocking every PR built offdevelop(including unrelated ones, e.g. Fix iOS AR passthrough: pixel format crash, tile thread-budget overruns, missing render prep, and reverse-Z mismatch #1427) because it has a zero-warning budget and [Patch] fall back to live first-responder check for text-field key gating #1424 introduced 3 strict-concurrency warning sites.shouldHandleKey(InputSystem+Keyboard.swift) added in [Patch] fall back to live first-responder check for text-field key gating #1424 synchronously accessesNSApp.keyWindow?.firstResponderfrom a plainnonisolatedinstance method;NSApp,.keyWindow, and.firstResponderare all@MainActor-isolated, producing 3 warnings.shouldHandleKeyis only ever called from anNSEventlocal monitor handler, which AppKit always invokes on the main thread — the isolation is genuinely held at runtime, the compiler just can't prove it from this un-annotated method. Wrapped the access inMainActor.assumeIsolated { ... }rather than marking the whole type@MainActoror threadingasyncthrough the two call sites, keeping the diff minimal.Test plan
swift buildpassesswift build -Xswiftc -strict-concurrency=complete -Xswiftc -warn-concurrency(the guardrail's exact build) produces zero warnings in this filemake format— no additional reformatting beyond the intended change