Skip to content

fix: app target fails to build under Xcode 26 beta (#ImplicitStrongCapture)#2162

Open
jasonpaulso wants to merge 1 commit into
exo-explore:mainfrom
jasonpaulso:fix/first-launch-weak-capture
Open

fix: app target fails to build under Xcode 26 beta (#ImplicitStrongCapture)#2162
jasonpaulso wants to merge 1 commit into
exo-explore:mainfrom
jasonpaulso:fix/first-launch-weak-capture

Conversation

@jasonpaulso

Copy link
Copy Markdown

Summary

The outer onReceive closure in EXOApp.swift captures controller strongly while the nested onComplete closure declares [weak controller]. Newer Swift toolchains (Xcode 26 beta) reject this mismatch under #ImplicitStrongCapture:

error: 'weak' ownership of capture 'controller' differs from implicitly-captured strong reference (#ImplicitStrongCapture)

so the EXO app target no longer builds. One-liner: capture weakly at the outer closure, matching the intent the nested closure already expresses.

Verified building the app with both Xcode 26.5 (current) and the Xcode 26 beta toolchain.

🤖 Generated with Claude Code

The outer onReceive closure captured controller strongly while the
nested onComplete closure declared [weak controller]; newer Swift
toolchains (Xcode 26 beta) reject the mismatch under
#ImplicitStrongCapture and the app target fails to build. Capture
weakly at the outer closure as the nested one already intends.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 10, 2026 21:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the SwiftUI .onReceive handler for first-launch readiness to adjust capture semantics (likely aiming to prevent an unintended strong reference).

Changes:

  • Adds a [weak controller] capture list to the .onReceive(controller.$isFirstLaunchReady) closure.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/EXO/EXO/EXOApp.swift
} label: {
menuBarIcon
.onReceive(controller.$isFirstLaunchReady) { ready in
.onReceive(controller.$isFirstLaunchReady) { [weak controller] ready in
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.

2 participants