Hm. The way CodingKeys synthesis works is that it does a lookup first and only synthesizes a custom one if the look fails. In this case, that comes out to "lookup in Inner -> lookup in Outer -> synthesize in Outer" and we never get back to "synthesize in Inner". I think that means we should be doing a qualified lookup into the Self type, even though that's technically a breaking change.
Additional Detail from JIRA
md5: 905f4d7055e6d21048c58a6d805c48d7
Issue Description:
Referencing the compiler-generated
CodingKeys
enum within theinit
of a nestedDecodable
orEncodable
fails. For example:However, this works perfectly fine for objects conforming to
Codable
:When an explicitly-defined CodingKeys enum is provided, everything works as expected:
Possibly related to https://bugs.swift.org/browse/SR-5215
The text was updated successfully, but these errors were encountered: