Repository navigation
JNI: preserve synchronous actor witnesses with standard constraints - #14
Merged
teamhimeh merged 1 commit intoOct 23, 2026
Merged
Conversation
Treat the standard AnyObject and Sendable constraints as nonisolating during actor-property witness discovery, without bypassing isolation on locally declared protocols with the same name. Add extraction, generator, and JNI runtime regressions for synchronous getters.
teamhimeh
added a commit
that referenced
this pull request
Oct 23, 2026
teamhimeh
force-pushed
the
codex/fix-actor-property-standard-constraints
branch
from
October 23, 2026 08:49
e5d844f to
b0b577d
Compare
teamhimeh
added a commit
that referenced
this pull request
Oct 23, 2026
…cies docs: extend upstream PR dependency map through origin #14
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.
Problem
JNI extraction treats an immutable actor property as asynchronous when its protocol inherits
AnyObjectorSendable, including theirSwift.-qualified spellings. These standard constraints introduce no actor isolation, but are absent from SwiftExtract's built-in Swift symbol table, so the synchronous protocol-witness check rejects them.For example:
Previously, the generated actor getter returned
CompletableFuture<Long>. With this change, Java callers can read the synchronous witness directly:The Swift thunk continues to read
(record as any Identified).identifier, preserving synchronous access across module boundaries.Changes
AnyObject,Swift.AnyObject,Sendable, andSwift.Sendableas nonisolating standard constraints during actor-property witness discovery.Sendableretain their actual isolation checks.Sendablein extraction regressions. Check both synchronous Java signatures and protocol-based Swift downcalls in generator regressions.long.Validation
Sendableisolation regression passes before and after.swift test --disable-experimental-prebuilts --disable-sandbox --jobs 4: full Swift test suite passed. One existing test requiring Android API 34/35 platform data was skipped../gradlew :Samples:SwiftJavaExtractJNISampleApp:test --no-daemon: all 296 Java tests passed with no failures or skips, including the new synchronous actor getter test.swift-format lint --stricton changed Swift files andgit diff --checkpassed.Tested with Apple Swift 6.4 and JetBrains Runtime 25.0.2 on macOS.
Dependency
This follows #4. The base branch already contains actor-property witness discovery and protocol-based thunk dispatch; this diff extends the handling of inherited standard constraints.