[swift-evolution] Type-annotated throws

Douglas Gregor dgregor at apple.com
Thu Sep 1 19:28:59 CDT 2016


> On Aug 29, 2016, at 12:14 PM, Charles Srstka via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> On Aug 29, 2016, at 4:18 AM, Tino Heth via swift-evolution <swift-evolution at swift.org <mailto: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.

Given that SE-0112 bridges *all NSError values in Objective-C* to Error, removing Error is a non-starter.

	- Doug


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160901/6ff0e957/attachment.html>


More information about the swift-evolution mailing list