Implementation details for Property Wrappers and KeyedContainers
mainDevelopers implementing or modifying core logic should be aware of these internal behaviors:
- Property Wrapper Storage: Swift stores property wrappers with an underscore prefix (e.g.,
@SmartAny var nameis stored as_name). TheDecodingCachehandles this mapping. - KeyedContainer Initialization: The
_convertDictionary()method inKeyedContaineris executed exactly once during container initialization. All subsequent property decoding relies on this transformed dictionary. - Patcher Type Conversion: Type conversions within a
Patcher(e.g.,String→Int) must be bi-directionally safe. You must validate that the input is valid (e.g., a valid numeric string) rather than silently returning a default like0.