> On May 16, 2016, at 2:35 AM, bhargav gurlanka via swift-users 
> <[email protected]> wrote:
> 
> Hi all,
> 
> Could someone please tell me why the following fails?
> 
> func foo(f: () throws -> () = {}) rethrows {
>     try f()
> }
> 
> // Fine
> foo({ })
> 
> // This fails with error:
> //    call is to 'rethrows' function,
> //    but a defaulted argument function can throw
> foo()
> 
> Why should I have to write "try foo()", shouldn't it take the default value 
> (non throwing closure)?

This looks like a bug. We'd appreciate a bug report on bugs.swift.org if you 
have some time.

-Joe
_______________________________________________
swift-users mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to