[swift-evolution] Why you can't make someone else's class Decodable: a long-winded explanation of 'required' initializers

Slava Pestov spestov at apple.com
Thu Aug 3 01:00:57 CDT 2017

> On Aug 2, 2017, at 10:48 PM, David Hart <david at hartbit.com> wrote:
> Somewhat related: I have a similar problem in a project where I need two different Codable conformances for a type: one for coding/decoding from/to JSON, and another one for coding/decoding from/to a database row. The keys and formatting are not identical. The only solution around that for now is separate types, which can be sub-optimal from a performance point of view.

Actually if the wrapper types are structs with a single field, their use should not introduce any additional overhead at runtime.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170802/8c4e72ba/attachment.html>

More information about the swift-evolution mailing list