Commit Graph

12 Commits

Author SHA1 Message Date
Doug Gregor
36a0c434ea Generalize _BridgedNSError to RawRepresentable types with any integral RawValue.
Part of rdar://problem/20577517, which will depend on this protocol.

Swift SVN r28795
2015-05-19 22:40:15 +00:00
Doug Gregor
94aafe1f33 De-underscore _MachError, _POSIXError, _NSCocoaError, _NSURLError.
Turns rdar://problem/20536610 into API, per scattered but positive API
review feedback.

Swift SVN r28756
2015-05-19 05:53:36 +00:00
Doug Gregor
bddf134a87 Factor _NSCocoaError into a struct whose values are split across frameworks.
The Cocoa error domain is comprised on error codes from Foundation,
CoreData, and AppKit. Rather than try to collect all of the error
codes into a single enum in Foundation, use a struct that conforms to
ErrorType. Part of rdar://problem/20536610.

Swift SVN r28755
2015-05-19 05:53:34 +00:00
Doug Gregor
1d6602ed73 Add bridging for the Mach error domain.
Swift SVN r28626
2015-05-15 16:53:29 +00:00
Doug Gregor
af6d4c5b6f Map the NSError POSIX domain into our error-handling scheme.
More of rdar://problem/20536610. _POSIXError is underscored because
this work needs to go to API review still.

Now with a proper build condition for _POSIXError on Darwin.

Swift SVN r28625
2015-05-15 16:22:20 +00:00
Ted Kremenek
2c3d0308a3 Revert "Map the NSError POSIX domain into our error-handling scheme."
This is breaking the bots.

Swift SVN r28615
2015-05-15 06:01:48 +00:00
Doug Gregor
1fa59f475a Map the NSError POSIX domain into our error-handling scheme.
More of rdar://problem/20536610. _POSIXError is underscored because
this work needs to go to API review still.

Swift SVN r28613
2015-05-15 05:31:25 +00:00
Doug Gregor
75f88af29a Make NSError error domain enums Equatable and Hashable.
Swift SVN r28568
2015-05-14 16:42:12 +00:00
Doug Gregor
7449c3b6ff Use protocol extensions to eliminate boilerplate in bridged NSError domains.
Swift SVN r28567
2015-05-14 16:42:10 +00:00
Doug Gregor
79e93e358c Add _NSURLError enum to cover the NSURLError error domain.
Swift SVN r28564
2015-05-14 06:53:55 +00:00
Doug Gregor
88b679969c Get availability annotations right for NSCocoaError.
Fix the script to not wantonly drop availability annotations, and
update NSCocoError accordingly. Also drop in a reinterpret-casting
rawValue initializer, which matches what we get when importing enums
from C.

Swift SVN r28563
2015-05-14 06:53:52 +00:00
Doug Gregor
cfbe2e0921 Hard-code the Cocoa error domain mapping using the results of a simple script.
Bridging the Cocoa error domain requires us to gather constants from
Foundation, CoreData, and AppKit, then pulling those into a single
(_)NSCocoaError enum that conforms to
_ObjectiveCBridgeableErrorType.

Rather than using a table extracted from the appropriate Cocoa headers
and pushing that through gyb, just hardcode the resuting Swift code,
which is produced (manually) by an enumeration-parsing script. Thanks
to Dave for pointing out that I was holding gyb wrong.

... and apologies for the Perl.

Long term, we need a better solution here, but this will suffice for
the short term.

Swift SVN r28560
2015-05-14 05:39:45 +00:00