Files
alhafram 2055bc3e76 Fix circular reference when property wrapper references CodingKeys (#88477)
### **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:**
2026-06-04 19:06:48 -07:00
..