[swift-evolution] Type-annotated throws
xiaodi.wu at gmail.com
Fri Aug 26 12:10:35 CDT 2016
I think the core team has previously mentioned some positive notions about
typed throws, so it'd be interesting to hear what they have in mind at this
point (or, more likely, at the point when they're no longer swamped with
getting Swift 3 out the door).
On Fri, Aug 26, 2016 at 11:55 AM, Rod Brown via swift-evolution <
swift-evolution at swift.org> wrote:
> On Fri, Aug 26, 2016 at 5:43 PM, Rod Brown via swift-evolution <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
> 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 :)
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution