fix(macos): suppress Swift compiler warnings
Merged
QE
4d ago+10+10+01234567890123456789-7-7-0123456789
Summary
- Replace unsafe force cast with
unsafeDowncastinAXFocusOperationsfor proper type-safe handling ofCFBoolean - Fix sendability warning in
AXFrameCoordinatorby reconstructing the application element locally instead of capturing it across async boundaries - Update closure syntax in
MacOSPlatform+WindowSnapshotDiscoveryto clarify closure scope - Replace unsafe
String(cString:)with explicit null-terminator handling inWindowSnapshotRefreshPolicyto handle C strings safely
Testing
- Swift build completes without warnings:
python3 script/verify.py local - No functional behavior changes; warnings only
[!NOTE]
Fix Swift compiler warnings in DefiMacOS accessibility code
- Removes a forced cast in
AXFocusOperations.readFocused by using an unchecked downcast after the existing CF type-identifier check (AXFocusOperations.swift)
- Fixes
appBundleIdentifier(processID:) to decode the non-null portion of the proc_pidpath buffer as UTF-8, so bundle lookup gets a clean executable path (WindowSnapshotRefreshPolicy.swift)
- Reworks the queued restoration closure in
AXFrameCoordinator to capture the restoration token, recreate the application accessibility element from the process ID at execution time, and record failed restorations against that element (AXFrameCoordinator.swift)
- Adds parentheses around a closure in the window-retry deadline check (MacOSPlatform+WindowSnapshotDiscovery.swift)
Macroscope summarized 50dce2d.