[swift-evolution] [Review] SE-0112: Improved NSError Bridging

Charles Srstka cocoadev at charlessoft.com
Fri Jul 1 19:25:06 CDT 2016


> On Jul 1, 2016, at 4:12 PM, Douglas Gregor via swift-evolution <swift-evolution at swift.org> wrote:
> 
> FYI, in-progress implementation is available at:
> 
> 	https://github.com/apple/swift/tree/nserror-bridging <https://github.com/apple/swift/tree/nserror-bridging>
> 
> The only issue I’ve found so far with the proposal is this bit:
> 
> 	When we introduce this bridging, we will need to remove NSError's conformance to ErrorProtocol to avoid creating cyclic implicit conversions. However, one can still explicitly turn an NSError into ErrorProtocol via a bridging cast, e.g., nsError as ErrorProtocol.
> 
> This doesn’t work, because the model really needs NSError to conform to ErrorProtocol. Instead, we should break the implicit conversion by not allowing an implicit conversion from an arbitrary ErrorProtocol to NSError, which is in line with what SE-0072 would do anyway.

What exactly in the model causes it to require NSError to conform to ErrorProtocol?

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160701/1224397c/attachment.html>


More information about the swift-evolution mailing list