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

Codable type with constant property with random default value

    XMLWordPrintable

    Details

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

      Description

      A constant property - of a Codable type - having a random default value, cannot be assigned the encoded value after decoding. This appears to be expected behavior, however, it maybe the case that we can make this more clear to the developer. Here is a gist explaining this issue:

       

      https://gist.github.com/tinder-garricnahapetian/1e063a42c3fc94f60b5fe2e2a3e9d935

        Attachments

          Activity

            People

            • Assignee:
              itaiferber Itai Ferber
              Reporter:
              garricn Garric Nahapetian
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: