Commits

Doug Gregor committed ca4a32b5a9c
[SE-0112] Bridge NSError to ErrorProtocol. Introduce bridging of NSError to ErrorProtocol, so an Objective-C API expressed via an "NSError *" will be imported using ErrorProtocol in the Swift. For example, the Objective-C method: - (void)handleError:(NSError *)error userInteractionPermitted:(BOOL)userInteractionPermitted; will now be imported as: func handleError(_ error: ErrorProtocol, userInteractionPermitted: Bool) This is bullet (3) under the proposed solution of SE-0112. Note that we made one semantic change here: instead of removing the conformance of NSError to ErrorProtocol, which caused numerous problems both theoretical and actual because the model expects that an NSError conforms to ErrorProtocol without requiring wrapping, we instead limit the ErrorProtocol -> NSError conversion that would be implied by bridging. This is defensible in the short term because it also eliminates the implicit conversion, and aligns with SE-0072, which eliminates implicit bridging conversions altogether.