Commit Graph

14 Commits

Author SHA1 Message Date
Itai Ferber
f088cfbdfe Add DecodingError.dataCorrupted conveniences
DecodingError.dataCorrupted is an error most commonly thrown from user code. We can expose conveniences to more easily throw .dataCorrupted errors.
2017-06-28 14:34:35 -07:00
Itai Ferber
92fccf964b Fix coding error bridging to NSError
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.
2017-06-28 14:33:15 -07:00
Itai Ferber
8f38678911 Expose underlyingError on coding errors
Some errors are caused by others — this allows us to expose the underlying problem.
2017-06-28 14:31:53 -07:00
Itai Ferber
41f93ca9d3 Improve runtime errors for conditional types 2017-06-21 15:52:31 -07:00
Roman Levenstein
890c2d5015 Re-factor Codable.decode functions to reduce the standard library code size
Move the error reporting slow-path into a separate function, which is not inlined or specialized.
This reduced the stdlib code size by almost 1%.
2017-06-05 16:28:37 -07:00
sushangjin
279f4d9f8e ditionary-decodable-fix 2017-06-05 11:40:12 +08:00
Itai Ferber
d16297dad5 Introduces changes to Codable stdlib API
* 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
2017-05-22 09:29:36 -07:00
Nate Cook
817a1efa3b [stdlib] Documentation revisions
- 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
2017-05-17 11:58:08 -05:00
Itai Ferber
1eb73b3b62 Add Dictionary and Set {En,De}codable conformance 2017-05-02 17:03:48 -07:00
Itai Ferber
7778fc2fb3 Fix encoding container linker errors
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.
2017-04-29 12:18:49 -07:00
Itai Ferber
f7cd0a6343 Add Codable conformance to Array 2017-04-28 23:38:25 -07:00
Itai Ferber
e1e67844a8 Split RawRep extensions for Encodable + Decodable
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
2017-04-28 11:15:04 -07:00
Itai Ferber
53d82b1923 Rename sequence type to avoid ambiguity 2017-04-27 10:22:03 -07:00
Itai Ferber
cecf00d1f1 Integrate *Codable protocols and associated types
Add Encodable and Decodable protocols, along with associated container
types, default implementations, and extensions to the standard library
2017-04-25 13:04:27 -07:00