JNI: fix non-compiling async thunks for protocol boxes and generic types - #905
Open
Flatout73 wants to merge 1 commit into
Open
JNI: fix non-compiling async thunks for protocol boxes and generic types#905Flatout73 wants to merge 1 commit into
Flatout73 wants to merge 1 commit into
Conversation
Flatout73
force-pushed
the
bugfix/dollar-sign
branch
from
August 23, 2026 16:11
a721f88 to
ec202f8
Compare
Flatout73
marked this pull request as ready for review
August 23, 2026 16:12
Flatout73
force-pushed
the
bugfix/dollar-sign
branch
from
August 23, 2026 16:15
ec202f8 to
c545dda
Compare
This was referenced Aug 23, 2026
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.
Motivation
Async methods in JNI mode capture
selfinto theTaskvianonisolated(unsafe)bindings. The capture always referenced
<param>$, but that binding only exists forclass/actor lowering (
.extractSwiftValue). Protocol boxes loadselfinto<param>Existential$, and generic-Self downcalls render inside the opener extensionwhere
selfTypePointeris never bound — so the generated Swift referenced unboundidentifiers and failed to compile.
Changes
<param>$forclasses/actors,
<param>Existential$for protocol boxes.nor binds it, and the task body never uses it.
Testing
New
JNIAsyncSelfCaptureTestspin the generated captures for all three selfshapes (class, protocol box, generic class); the generic and protocol tests fail
without this change. Full test suite passes (654 tests).
🤖 Fixed with help of Claude Code
#865