[swift-evolution] Type-annotated throws

Charles Srstka cocoadev at charlessoft.com
Mon Aug 29 14:14:31 CDT 2016


> On Aug 29, 2016, at 4:18 AM, Tino Heth via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'm quite skeptical here (Java has already been mentioned…), but if it's done, I'd vote for removing ErrorType:
> This empty protocol always felt a little bit odd to me, and when each function has information about what errors to expect, imho there is absolutely no benefit associated with conformance.
> Even now, it's not that much — or does anyone actually consult a list of conforming types for error handling?
> 
> Tino

Error is far from empty; it appears that way, but it contains default implementations to make bridging to and from Cocoa NSError objects much more convenient, especially since SE-0112. Plus, it’s a protocol rather than a base class, so conforming it doesn’t really constrain your design in any way.

-1 on removing Error.

Charles

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160829/007b0dab/attachment.html>


More information about the swift-evolution mailing list