-
Notifications
You must be signed in to change notification settings - Fork 63
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
Unexpected behavior #58
Comments
Hi @ericlewis! There doesn’t appear to be any decoding code in your example above that would throw. Can you provide a full sample that reproduces the issue? There are definitely some gotchas around codability, some of which we can’t work around when it comes to coding containers, but if there is a bug we can fix we’d love to know! |
This is currently a Swift limitation in which only string and integer keys properly encode/decode into dictionaries. A fix has been proposed and accepted into Swift: https://github.com/apple/swift-evolution/blob/main/proposals/0320-codingkeyrepresentable.md |
Ah! Seems like that is the case then @mbrandonw. |
@stephencelis it just using a |
@ericlewis That was one of the issues around decoding containers I was alluding to, just wanted to confirm what |
Hey all, I was just trying something out and ran into an odd issue. I am not entirely sure what the compiler is thinking.
The below code has a problem when it comes to decoding, with
JSONDecoder
throwingExpected to decode Array<Any> but found a dictionary instead.
onfiles
, what is interesting is if we change the type to:[String: File]
it works perfectly fine. I didn't dig in to it much, but it seems like theExpressibleByArrayLiteral
conformance is being interpreted incorrectly.Problem code:
The text was updated successfully, but these errors were encountered: