Uploaded image for project: 'Swift'
  1. Swift
  2. SR-7897

Synthesized CodingKeys enum should conform to CaseIterable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:

      Description

      These two features were added separately, but would actually be so much more useful when combined.

      public struct S: Codable {
          var name: String = ""
          var age: Int8 = 42
      }
      

      There is no simple way of getting a list of all the fields in this struct, even though CodingKeys enum gets synthesized.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              moiseev Max Moiseev
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: