Encode enum cases without associated values#158
Conversation
Can you provide what is the error you getting? The change seems to be in the right direction. So the tests might need to be updated with latest data. |
| } | ||
| } else { | ||
| preSyntax("\(values.first!)") | ||
| "break" |
There was a problem hiding this comment.
Suggestion: You can add logic to conditionally include this break syntax depending on whether preSyntax returns any syntax.
| } | ||
| } | ||
|
|
||
| struct WithoutAssociatedVariables { |
There was a problem hiding this comment.
Suggestion: You can add test case for your original example as well, without the CodedAt. You can add it to CodableTests
| generatedCode | ||
| } | ||
| } else { | ||
| preSyntax("\(values.first!)") |
There was a problem hiding this comment.
I think this will cause unused variable warnings in case of your original example. Can you address that in someway? May be passing some flag to this preSyntax closure and customizing the output based on this flag?
Fixes #157
This breaks some
@IgnoreCodingInitializedtests but that API is too confusing for me. I have no idea what it is actually supposed to do, so I can't tell if the failing tests are actually breaking the intended use. A maintainer needs to look at that.