Skip to content

Remove previous hack for SR-5206 #11315

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

Merged
merged 2 commits into from
Aug 3, 2017

Conversation

itaiferber
Copy link
Contributor

What's in this pull request?
Better resolves SR-5206 until the introduction of conditional conformance.

As a temporary workaround for SR-5206, certain Foundation types which had custom behavior in JSONEncoder and JSONDecoder were granted special knowledge of those types internally in order to preserve strategies on encode/decode.

This replaces that special knowledge with a more general-purpose fix that works for all types and all encoders/decoders.

Thanks to @norio-nomura for thinking of the approach on this.

As a temporary workaround for SR-5206, certain Foundation types which had custom behavior in JSONEncoder and JSONDecoder were granted special knowledge of those types internally in order to preserve strategies on encode/decode.

This replaces that special knowledge with a more general-purpose fix that works for all types and all encoders/decoders.
@itaiferber
Copy link
Contributor Author

@swift-ci Please test macOS

@itaiferber
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - fbdcbee
Test requested by - @itaiferber

@itaiferber
Copy link
Contributor Author

Mm. These fileprivate extensions are visible in accessibility checking, so are changing the errors that you'd get when you fail to inherit init(from:) from a superclass. Changing the parameter names to these initializers should prevent this.

Fixes unit test failues stemming from fileprivate "init(from:)" visibility on Decodable things.
@itaiferber
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2017

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - fbdcbee
Test requested by - @itaiferber

@swift-ci
Copy link
Contributor

swift-ci commented Aug 2, 2017

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - fbdcbee
Test requested by - @itaiferber

@itaiferber itaiferber merged commit 2e5817e into swiftlang:master Aug 3, 2017
@itaiferber itaiferber deleted the fix-sr-5206-hack branch August 3, 2017 17:37
@norio-nomura
Copy link
Contributor

@itaiferber Can this change go to Swift 4.0.1?

@itaiferber
Copy link
Contributor Author

@norio-nomura Unfortunately, the bar for inclusion into the next patch release is incredibly high, and this isn't considered a high enough priority item for inclusion. However, I believe I can get this pushed into the release after that.

@norio-nomura
Copy link
Contributor

@itaiferber Thank you for your reply and information.🙏
I will look forward to that release.

itaiferber added a commit to itaiferber/swift that referenced this pull request Oct 10, 2017
@nerdsupremacist
Copy link

Do we know if Xcode 9.1 will ship with a toolchain that includes this fix?

@itaiferber
Copy link
Contributor Author

@mathiasquintero It should, yes.

@jrose-apple
Copy link
Contributor

Ah, that's not correct. Xcode 9.1 contains the targeted fixes that went to swift-4.0-branch after the 4.0 release.

@itaiferber
Copy link
Contributor Author

@mathiasquintero @jrose-apple Sorry! Misread that as "Swift 4.1" instead of "Xcode 9.1" — skimmed too quick. Jordan has the answer.

@nerdsupremacist
Copy link

nerdsupremacist commented Oct 12, 2017

@jrose-apple @itaiferber but wasn't this later cherrypicked to the 4.0 branch?

@jrose-apple
Copy link
Contributor

Heh, I missed that too, but that cherry-pick was very recent. We can't promise that that'll make it into Xcode 9.1 rather than a possible later point release before we're ready for Swift 4.1.

@nerdsupremacist
Copy link

nerdsupremacist commented Oct 12, 2017

Here's hoping for 4.0.2 rather than 4.1 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants