Skip to content

[4.0] Allow classes to share an Encoder with superclass#10538

Merged
parkera merged 1 commit intoswiftlang:swift-4.0-branchfrom
itaiferber:4.0-foundation-shared-encoders
Jun 23, 2017
Merged

[4.0] Allow classes to share an Encoder with superclass#10538
parkera merged 1 commit intoswiftlang:swift-4.0-branchfrom
itaiferber:4.0-foundation-shared-encoders

Conversation

@itaiferber
Copy link
Contributor

What's in this pull request?
Cherry-picks #10520 to swift-4.0-branch.

Explanation: On encode, we previously treated every container request as a push; instead, we should allow the same container type to be requested multiple times so a class can pass its Encoder directly to its superclass if it needs to.
Scope: Affects anyone trying to share an Encoder with their superclass when using JSONEncoder and PropertyListEncoder.
Radar: rdar://problem/32927085
Risk: Low
Testing: Adds unit tests to JSONEncoder and PlistEncoder to confirm expected behavior.

On encode, we previously treated every container request as a push;
instead, we should allow the same container type to be requested
multiple times so a class can pass its Encoder directly to its
superclass if it needs to.
@itaiferber
Copy link
Contributor Author

@swift-ci Please test

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.

2 participants