Skip to content

jextract/jni: Propagate generic parameters to Case types of generic enums#765

Open
sidepelican wants to merge 3 commits into
swiftlang:mainfrom
sidepelican:generic_enum_param
Open

jextract/jni: Propagate generic parameters to Case types of generic enums#765
sidepelican wants to merge 3 commits into
swiftlang:mainfrom
sidepelican:generic_enum_param

Conversation

@sidepelican
Copy link
Copy Markdown
Contributor

This PR is the first step toward supporting the extraction of generic associated values from generic enum.

Currently, the generated Case types for generic enums do not carry generic parameters.
While this isn't causing immediate issues, these parameters will be necessary in the future when we want to extract generic associated values from the Case.

public sealed interface Case {
  // `Wrapped` is not usable from the static context
  record Some(Wrapped arg0) implements Case {}
  record None() implements Case {}
}

This PR focuses solely on propagating the generic parameters of the enum type down to its Case type.

During this work, I encountered and fixed an issue in wrap-java where translation was failing when a nested type's parent type was generic.


Note

I have loved contributing to swift-java for a half year, but unfortunately, I have run out of time to continue doing so.
While I will keep following the development of swift-java, I won't be able to actively contribute as I did before.

Thank you so much for all your valuable code reviews.

@sidepelican sidepelican requested a review from ktoso as a code owner May 23, 2026 09:07
Comment thread Tests/SwiftJavaToolLibTests/JavaTranslatorTests.swift Outdated
@ktoso
Copy link
Copy Markdown
Collaborator

ktoso commented May 23, 2026

Oh too bad to hear you won’t have more time contributing … maybe in some hobby time :-)

Thanks for all the contributions, it’s all accounted for very useful improvements!

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.

2 participants