Skip to content

jextract/jni: support generic params : DataProtocol #669

Merged
ktoso merged 4 commits intoswiftlang:mainfrom
ktoso:wip-jni-dataprotocol-generic-translation
Apr 1, 2026
Merged

jextract/jni: support generic params : DataProtocol #669
ktoso merged 4 commits intoswiftlang:mainfrom
ktoso:wip-jni-dataprotocol-generic-translation

Conversation

@ktoso
Copy link
Copy Markdown
Collaborator

@ktoso ktoso commented Apr 1, 2026

Functions with <D: DataProtocol> generic constraints failed to translate because .foundationDataProtocol and .essentialsDataProtocol fell through to the default case in translateGenericTypeParameter.

This uses the automatic existential opening in the thunks!

The test thunks outputs are a bit huge but I found it useful to have them visually tbh... Worst case if much changes we can change them to be less checking

ktoso added 2 commits April 1, 2026 21:34
Functions with `<D: DataProtocol>` generic constraints failed to
translate because `.foundationDataProtocol` and `.essentialsDataProtocol`
fell through to the default case in `translateGenericTypeParameter`.
secondswiftObject$ = secondpointer$Existential$
return SwiftModule.verify(first: firstswiftObject$, second: secondswiftObject$).getJNILocalRefValue(in: environment)
}
"""
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

On the other hand... man that's a lot of code for the chunk... I'll just take the imp[important bits maybe

@ktoso ktoso force-pushed the wip-jni-dataprotocol-generic-translation branch from 85244fd to 573b85e Compare April 1, 2026 13:16
@ktoso ktoso merged commit 0bdba49 into swiftlang:main Apr 1, 2026
61 checks passed
@ktoso ktoso deleted the wip-jni-dataprotocol-generic-translation branch April 1, 2026 14:24
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.

1 participant