You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Did some investigation. Encodable conformance can be added pretty trivially by just encoding the value, but adding Decodable support doesn't work the same way since range can't be initialized from just the value.
Is your feature request related to a problem? Please describe.
Types that use Clamped properties lose automatic
Codable
conformance sinceClamped
itself does not conform to codable.Describe the solution you'd like.
Clamped
conforms toCodable
whenValue
itself isCodable
, encoding the wrapped value.Describe alternatives you've considered.
Manual
Codable
conformance is still possible for types using Clamped properties, but it is much more work.Additional context
It could be useful to also do this for other protocols such as
Hashable
.I would be willing to give this a shot and might put up a PR for it soon.
The text was updated successfully, but these errors were encountered: