Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a feature to generate Swift enums with associated values #71

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

hbmartin
Copy link

@hbmartin hbmartin commented Feb 13, 2023

associated enum diagram

https://app.diagrams.net/#G18NIEe1pXeDIdozJ2Kv4hiNurb4vmwLdB

@Alex009
Copy link
Member

Alex009 commented Feb 13, 2023

@hbmartin thanks for contribution!

can you show please example of generated code and kotlin source for this generated code?

@Alex009 Alex009 changed the base branch from master to develop February 13, 2023 06:56
@hbmartin
Copy link
Author

@Alex009 I added a test file that contains expected output at https://github.com/icerockdev/moko-kswift/pull/71/files#diff-6f9bcc9e1dfe050e77b438e13f7ecab7af5abbc22e6e44ddadeb8d0b4d708a38
Still making progress on the other todo's, does this look like its on a good path?

@hbmartin
Copy link
Author

hbmartin commented Mar 5, 2023

@Alex009 I don't plan any further work here now, we are using this in production and it is serving well.
I've attached a diagram to the description of this PR to explain the flow at a high level

@Alex009 Alex009 added this to the 0.7.0 milestone Mar 6, 2023

/**
* selector: ClassContext/associatedenum/com/icerockdev/library/associatedenum/TestingSealed */
public enum TestingSealedKs {
Copy link
Member

Choose a reason for hiding this comment

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

so, as i see, this feature not about swift's associated types usage but improved version of SealedToEnum with correct pass of sealed internal data to enum internal data, yes? looks good!

@Alex009 Alex009 self-requested a review August 14, 2024 02:03
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.

3 participants