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
It seems there is misprint in the realization of the public func enkotObject(_ object: [Koting]?, forKey key: AnyHashable). flatMap is used there and it leads to unwrapping of Data as an array of UInt8. As a result we get a massive collection of UInt8.
While dekoting we cast the collection to array of Data type and the cast always fails. Please, check the public func dekotObject<T: Koting>(forKey key: AnyHashable) -> [T]?.
I think simple use map instead of flatMap will make the mechanism behave as expected.
The text was updated successfully, but these errors were encountered:
Hello, @letko-dmitry .
Thank you so much for creating such a well-explained issue and making a PR.
Your PR is merged. No doubts the unwrapping was useless.
Also, I want to investigate the problem a bit more, I never thought of anything like this.
Hi,
It seems there is misprint in the realization of the
public func enkotObject(_ object: [Koting]?, forKey key: AnyHashable)
.flatMap
is used there and it leads to unwrapping ofData
as an array ofUInt8
. As a result we get a massive collection ofUInt8
.While dekoting we cast the collection to array of
Data
type and the cast always fails. Please, check thepublic func dekotObject<T: Koting>(forKey key: AnyHashable) -> [T]?
.I think simple use
map
instead offlatMap
will make the mechanism behave as expected.The text was updated successfully, but these errors were encountered: