I raised something very similar a little while ago too:
https://forums.swift.org/t/idea-enum-intcase-stringcase
I think the conversation got sidetracked on the Codable
stuff, but I was essentially just proposing auto-synthesised cases for enums with associated types.
I think IntCase
and StringCase
provide much more flexibility. It's nice to know the index/name of the enum case when handling custom Codable
implementations.