Skip to content

jextract/jni: Skip discriminator generation if enum has no cases#573

Open
sidepelican wants to merge 1 commit intoswiftlang:mainfrom
sidepelican:no_case_enum
Open

jextract/jni: Skip discriminator generation if enum has no cases#573
sidepelican wants to merge 1 commit intoswiftlang:mainfrom
sidepelican:no_case_enum

Conversation

@sidepelican
Copy link
Contributor

Currently, when the Swift enum has no cases, the generated Java code results in a compilation error.

error: sealed class must have subclasses
  public sealed interface Case {}
                ^

In Swift, it is a common idiom to use enums with no cases as namespaces.

I have updated the generator to skip the generation of any case-related code when an enum contains no cases.

@sidepelican sidepelican requested a review from ktoso as a code owner February 25, 2026 07:27
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