[swift-evolution] [Pitch] Reducing the bridging magic in dynamic casts

Charles Srstka cocoadev at charlessoft.com
Mon May 9 15:14:27 CDT 2016

> On May 6, 2016, at 2:04 AM, Adrian Zubarev via swift-evolution <swift-evolution at swift.org> wrote:
> The ugly NSError pattern could be rewritten and migrated to:
> do {
>    try something()
> } catch let error {
>    handle(error `bridge` NSError)
> }
> Is such a change complicated, what do you think?

I’ve made a pitch, "Consistent bridging for NSErrors at the language boundary”, which I believe would not only eliminate the need for “as” to contain bridging magic, but is also much less ugly than either the current pattern or the example above.

https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160502/016618.html <https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160502/016618.html>


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

More information about the swift-evolution mailing list