For the benefit of unkeyed containers, coding paths currently contain optional `CodingKey`s — unkeyed containers are allowed to report a `nil` key in a path. However, this is unhelpful for debugging purposes, or inspecting the coding path for context, since any unkeyed container simply reports `nil`, whether it’s at index 1 or 1000.
Now all containers are required to report a non-optional CodingKey for their segment of the coding path, and coding paths are now exposed as `[CodingKey]`.
CustomNSError briding only works when the CustomNSError conformance is in the same module as the original error declaration. We need to sink these down into the standard library.
* Add encodeNil(forKey:)/encodeNil() for keyed/unkeyed encoding
containers
* Add decodeNil(forKey:)/decodeNil() for keyed/unkeyed decoding
containers
* Give default implementation of decodeIfPresent(forKey:)/
decodeIfPresent(_:) on keyed/unkeyed decoding containers instead of
decode(forKey:)/decode(_:)
* Expose all encode/decode methods on keyed encoding & decoding
containers to allow overriding default methods (which were previously
not forwarding)
* Adds conformance of Optional to Codable
* encode(...) arguments are no longer Optional; Optional values go
through generic version
* encodeIfPresent added to KeyedEncodingContainerProtocol to mirror
decodeIfPresent
* JSONEncoder and PropertyListEncoder updated to reflect these changes
- remove additional 'characters' references from String docs
- improved language around escaping pointer arguments
- key path type abstracts
- codable type abstract revisions
- a few more NSString API fixes
The box types were previously fileprivate because they lived in
the Foundation overlay. As part of the Swift stdlib, though, they need
to be internal so they can be linked against.
You shouldn't need to be Codable in order to get these implementations;
being either Encodable or Decodable should be enough to get the relevant
default implementation