[swift-evolution] Type-annotated throws

Rod Brown rodney.brown6 at icloud.com
Fri Aug 26 11:55:03 CDT 2016

>> On Fri, Aug 26, 2016 at 5:43 PM, Rod Brown via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> (resent for Swift Evolution)
>> I’m a big fan of this idea. Currently “throws” seems like a very limited API - you know it’s throwing out something, but you can only hope to guess what that is or create fallbacks. Definitely a big +1 from me. A fallback for compatibility could be “throws” assumes “throws Any” and can be a warning?
> I’d suggest a bare `throws` = `throws ErrorType` (you can only throw ErrorType, right?) and be valid, I don’t see any reason to make it a warning (plus that keeps source compatibility). 

*hits head on desk*

How could I miss that?  `throws` = `throws ErrorType` makes perfect sense. It also means we can get some type safety, but it’s not lock in.

Thanks :)

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

More information about the swift-evolution mailing list