-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix JSONDecoder.decode(_,from:) behavior #4807
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
Conversation
Would you mind adding a test case to the |
Sure. I added a method named |
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.
Thank you for the contribution!
@swift-ci please test |
The discrepancy you describe in #4806 has probably been present for a long time. It appears that it is fixed already in https://github.com/apple/swift-foundation, which will become the Foundation implementation for the Linux and Windows toolchains at a future point. I will make sure that a test like this exists in swift-foundation. |
@swift-ci please test windows platform |
The macOS test failure is a known issue. |
Circling back, the behaviour fixed here is tested for in the following test of swift-foundation: |
JSONDecoder.decode(_,from:)
accepts a generic parameter, but it does not use any concrete type in practice.This PR fixes that use parameter
type
instead ofT.self
.This PR solves #4806
Example Code
on macOS:
on Linux: