[swift-users] Where CodingKey protocol is implemented on swift source code
shonorio at gmail.com
Wed Oct 4 17:38:49 CDT 2017
Thanks for the clarification.
Em qua, 4 de out de 2017 às 19:21, Itai Ferber <iferber at apple.com> escreveu:
> Hi Solli,
> CodingKey conformance for enums is synthesized by the compiler given
> certain rules — you can see mention of this in the Codable proposal
> [search for public protocol CodingKey].
> If you’re interested in specific implementation for how the compiler does
> this, you can refer to lib/Sema/DerivedConformanceCodingKey.cpp
> Happy to answer any questions on this you might have.
> — Itai
> On 4 Oct 2017, at 14:50, Solli Honorio via swift-users wrote:
> Studying "Codable.swift" and "JSONEncoder.swift" to understand how decoding
> works under the hood, I got confused about how CodingKey is implemented for
> 'enum'. Shouldn't have an extension of RawRepresentable to implement the
> CodingKey protocol?
> This is the answer I'm looking for, how the CodingKey protocol is
> implemented on enum?
> I appreciate any help, tks
> Solli Honorio
> "o animal satisfeito dorme". - Guimarães Rosa
> swift-users mailing list
> swift-users at swift.org
Enviado do Gmail para celular
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users