Skip to content
This repository has been archived by the owner on Jan 28, 2025. It is now read-only.

Annotating sealed class should export all child classes #26

Open
baconz opened this issue Aug 7, 2022 · 1 comment
Open

Annotating sealed class should export all child classes #26

baconz opened this issue Aug 7, 2022 · 1 comment

Comments

@baconz
Copy link

baconz commented Aug 7, 2022

If you annotate a sealed class with JsExport, it will export all of the child classes by default. KustomExport does not behave the same way. I found that:

@KustomExport
sealed class Foo {
    data class Bar(val numbers: List<Long>) : Foo()
}

Will fail with a compiler error. It seems the only way to export the child classes is to do:

@KustomExport
sealed class Foo

@KustomExport
data class Bar(val numbers: List<Long>) : Foo()
@glureau
Copy link
Member

glureau commented Aug 11, 2022

Thanks for your report! The behavior you describe is known, I've started working to deal with inner classes but it's adding some complexity in the generation code if I want to handle outer/inner classes properly (class naming and wrapping is more complex, but still feasible). As the workaround is very simple (for outer classe at least), we didn't prioritize this feature yet.
Keeping this ticket open for now, hoping I'll have some free time soon.
If you have some requirements that cannot be handled / are blockers for you, don't hesitate to share!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants