Skip to content

jextract/jni: Handle single-element tuples correctly#725

Open
sidepelican wants to merge 2 commits intoswiftlang:mainfrom
sidepelican:single_tuple
Open

jextract/jni: Handle single-element tuples correctly#725
sidepelican wants to merge 2 commits intoswiftlang:mainfrom
sidepelican:single_tuple

Conversation

@sidepelican
Copy link
Copy Markdown
Contributor

Code generation fails when a single-element tuple is used. In Swift, (T) is semantically identical to T, so attempting to access it via .0 causes a compiler error.

1375 |   let element_0_jni$ = tupleResult$.0.getJNILocalRefValue(in: environment)
     |                                     `- error: value of type 'String' has no member '0'

I've updated the generator to treat tuples with a single element as a single unwrapped value instead of a tuple.

@sidepelican sidepelican requested a review from ktoso as a code owner April 27, 2026 03:57
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