[6.3][Concurrency] A few more nonisolated(nonsending) fixes #89267
Open
xedin wants to merge 2 commits into
Open
[6.3][Concurrency] A few more nonisolated(nonsending) fixes #89267xedin wants to merge 2 commits into
nonisolated(nonsending) fixes #89267xedin wants to merge 2 commits into
Conversation
…osure isolation We need a contextual parent of the closure expression to determine whether it's a function conversion to a `nonisolated(nonsending)` function type, without that isolation checker would incorrectly mark the closure `@concurrent` in cases where solver conservatively used a conversion instead of apply `nonisolated(nonsending)` onto the closure directly. Resolves: swiftlang#87097 Resolves: rdar://170007831 (cherry picked from commit 335db2a)
…lated(nonsending)` This is a backport of swiftlang#89015 Since SILFunctionType doesn't support a full range of isolation kinds not setting the isolation of the thunk that reabstracts a function value into a `nonisolated(nonsending)` one, results in `OptimizeHopToExecutor` incorrectly removing hops from the thunk. In turn, at the call site, synchronous code that follows a call to `nonisolated(nonseding)` function value through a reabstraction thunk, would be executed on the isolation of the function value called by the thunk instead of returning to the caller's context. Resolves: rdar://176709091 Resolves: swiftlang#88993
Contributor
Author
|
@swift-ci please test |
ktoso
approved these changes
May 19, 2026
Contributor
ktoso
left a comment
There was a problem hiding this comment.
Lgtm on these targeted fixes
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.
Explanation:
This is backport of a few fixes that address recently discovered regressions.
First issue is related to incorrect isolation inference when closure specifies explicit captures, the second one fixes reabstraction thunk isolation and prevents
OptimizeHopToExecutorfrom removing valid hop backs.Resolves: rdar://170007831, rdar://176709091
Resolves GitHub Issues: Closure with isolated actor parameter resumes on incorrect isolation #88993, nonisolated(nonsending) closure loses isolation with capture list #87097
Main Branch PRs: [SILGen] Set correct isolation on thunks that reabstract into `noniso… #89015, [Concurrency] Look-through explicit capture lists when determining cl… #87163
Risk: Very Low. Both changes are very narrow and apply only to
nonisolated(nonsending)declarations/values (inference viaNonisolatedNonsendingByDefaultupcoming feature flag is disabled by default).Reviewed By: @ktoso
Testing: Added new test-cases to the suite.