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

Improve Codable Diagnostics When CodingKeys Do Not Match Properties

    XMLWordPrintable

    Details

      Description

      Consider

      struct Foo: Codable {
        var bar: String
      
        private enum CodingKeys: String, CodingKey {
          case ba
        }
      }
      

      What we should have is some kind of notes that explain that the manually-provided CodingKeys are insufficient to satisfy the ad-hoc "nested type requirement" of Codable because of the typo. Instead, all we say is that Foo doesn't conform to Codable.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            rwidmann Robert Widmann
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated: