Current:
extension Foo: Defaults.Serializable, Defaults.PreferRawRepresentable {}
I think this may be better:
extension Foo: Defaults.Serializable.RawRepresentable {}
This is shorter, but more importantly, it makes the choice explicit. Users should prefer this over Defaults.Serializable
. Defaults.Serializable
has a big flaw. For example, you have a struct X: Codable, Defaults.Serializable
. You save data with it, but later on, you add a RawRepresentable
conformance. The previous persisted version of the struct can no longer be loaded as it's saved using the Codable
bridge, but now tries to load using the RawRepresentable
bridge.
// @hank121314 Thoughts? Any better way to prevent this problem?
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too