mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
2055bc3e76
### **Explanation:** When a property wrapper's initializer references the enclosing type's CodingKeys enum (e.g. @Wrapper(key: CodingKeys.bar)), the compiler enters a dependency cycle: StoredPropertiesRequest → PropertyWrapperBackingPropertyTypeRequest → ResolveImplicitMemberRequest (resolve CodingKeys) → ResolveValueWitnessesRequest (Codable conformance) → StoredPropertiesRequest (cycle). ### **Scope:** Codable synthesis, property wrappers ### **Issues:** Fixes #88459 ### **Original PRs:** N/A ### **Risk:** Low. The change only affects the ResolveCodingKeys path in ResolveImplicitMemberRequest and is guarded by two conditions: (1) StoredPropertiesRequest must be active for the same type, and (2) the user must have explicitly defined a CodingKeys enum. All 74 existing Codable synthesis tests pass. ### **Testing:** Added test/decl/protocol/special/coding/struct_codable_property_wrapper_codingkeys.swift with 5 test cases: simple wrappers with CodingKeys, custom key mappings, mixed wrapped/unwrapped properties, Decodable-only, Encodable-only. All 74 Codable tests pass. Runtime encode/decode verified. ### **Reviewers:**