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

Swift backend doesn't support single entry enums #93

Open
chiroptical opened this issue Dec 4, 2024 · 0 comments
Open

Swift backend doesn't support single entry enums #93

chiroptical opened this issue Dec 4, 2024 · 0 comments

Comments

@chiroptical
Copy link
Collaborator

data X = X

mobileGenWith (defaultOptions {dataRawValue = Just Str}) ''X

should be able to produce

enum X {
  case x
}

Currently we have an error specific to swift here

moat/src/Moat.hs

Lines 525 to 532 in 2eda1d2

SingleConNonRecord (nameStr -> n) ->
n
++ ": Cannot get moat with single-constructor "
++ "non-record types. This is due to a "
++ "restriction of Swift that prohibits structs "
++ "from not having named fields. Try turning "
++ n
++ " into a record!"
but apparently this works fine.

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

No branches or pull requests

1 participant