-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle coercion of AnyHashable #61
Conversation
@@ -179,11 +216,11 @@ extension Array: SelectionSetEntityValue where Element: SelectionSetEntityValue | |||
fatalError("\(Self.self) expected list of data for entity.") | |||
} | |||
self = data.map { | |||
#if swift(>=5.4) | |||
if DataDict._AnyHashableCanBeCoerced { | |||
Element.init(_fieldData:$0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like these lines need return statements now since its no longer technically a single line of code because of the #if
check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, thanks. just fixed that. Oddly it was still compiling and running fine on my machine with out them. I have no idea how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice work!
@AnthonyMDev Called from Please let me know how I can help to get this resolved ... Best, |
Thank you for the detailed report! I'll look into this today. |
I had forgotten the We'll get a patch out ASAP |
In iOS versions 14.4 and lower,
AnyHashable
coercion does not work. On these platforms, we need to do some additional unwrapping and casting of the values to avoid crashes and other run time bugs.In addition to doing some more explicit handling of the null values, this PR changes the check for the coercion from
#if swift (>=5.4)
toif #available(iOS 14.5, *)
. It turns out that this is not particularly related to the swift version, but to the iOS version being run.This PR has been tested locally on iOS 14.4, 14.5, and 17.0.