sindresorhus / Defaults

💾 Swifty and modern UserDefaults
https://swiftpackageindex.com/sindresorhus/Defaults/documentation/defaults
MIT License
1.93k stars 115 forks source link

Fixes infinite recursion when casting `AnySerializable` to wrong type #147

Closed leoMehlig closed 10 months ago

leoMehlig commented 10 months ago

If a values associated type Serializable , equals the values type, toValue would infinitely call itself.

The test testWrongCast reproduces this and I fixed it by comparing the nextType with the current type.