Commits

Doug Gregor committed b86b8126a7c
[SE-0112] Import an Objective-C error enum as a struct wrapping NSError. A given Objective-C error enum, which is effectively an NS_ENUM that specifies its corresponding error domain, will now be mapped to an ErrorProtocol-conforming struct that wraps an NSError, much like NSCocoaError does. The actual enum is mapped to a nested "Code" enum. For example, CoreLocation's CLError becomes: struct CLError : ErrorProtocol { let _nsError: NSError // ... @objc enum Code : Int { case ... } } This implements bullet (2) in the proposed solution of SE-0112, so that Cocoa error types are mapped into structures that maintain the underlying NSError to allow more information to be extracted from it.