Skip to content

jextract: deduplicate protocol default JNI thunks - #916

Open
Hokila wants to merge 1 commit into
swiftlang:mainfrom
Hokila:fix-891-protocol-default-jni
Open

Hokila wants to merge 1 commit into
swiftlang:mainfrom
Hokila:fix-891-protocol-default-jni

Conversation

@Hokila

@Hokila Hokila commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Deduplicate existential-box JNI dispatch thunks by their complete JNI C symbol name.
  • Keep the first thunk and preserve the existing Java API and dispatch path.
  • Share JNI parameter/signature construction between deduplication and emission.
  • Add a regression test for a protocol requirement with a default implementation.

Fixes #891

Testing

  • swift test --filter JNIProtocolTests (18 tests)
  • swift test --filter JExtractSwiftTests (578 tests, 73 suites)
  • xcrun swift-format lint --configuration .swift-format on changed Swift files
  • Generated fixture Swift passed swiftc -typecheck

The full test suite remains environment-blocked for Java/Gradle tests because no Java Runtime is installed.

@Hokila
Hokila requested a review from ktoso as a code owner September 15, 2026 08:17
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.

Compilation error for default protocol function implementation: "invalid redeclaration of..."

1 participant