[Shared] Fixes error encoding CodableError Int/UInt user info values

This commit is contained in:
Riley Testut
2022-12-12 15:53:53 -06:00
parent 8d8d8fdd61
commit 08dcd9d146

View File

@@ -66,6 +66,7 @@ extension CodableError
{
case let string as String: self = .string(string)
case let number as Int: self = .number(number)
case let number as UInt: self = .number(Int(number)) // No idea why this is necessary, but some values fail above cast (despite being in range). And appears to be random :(
case let error as NSError: self = .codableError(CodableError(error: error))
case let array as [Any]: self = .array(array.compactMap(UserInfoValue.init))
case let dictionary as [String: Any]: self = .dictionary(dictionary.compactMapValues(UserInfoValue.init))