[swift-evolution] Update the signature of ObjectiveC.autoreleasepool [SR-842]

Dmitri Gribenko gribozavr at gmail.com
Mon Mar 21 11:07:37 CDT 2016


On Mon, Mar 21, 2016 at 7:56 AM, Timothy Wood <tjw at omnigroup.com> wrote:
> What I meant was
> whether it is possible for code outside stdlib to easily wrap a
> autoreleasepool that does not have `rethrow` applied and make one that does.
> Or, more generically, is it possible in Swift, given only `func f(@noescape
> body: Void -> Void)` to write `func f(@noescape body: Void throws -> Void)
> rethrows`? It seemed to me like it isn’t possible, since the wrapper needs
> to capture the error inside a do/catch in a var and then optionally re-throw
> it outside the do/catch, but the rethrow can’t be done (as far as I can see)
> since that seems to make the compiler thing that the function should be
> marked as `throws` instead of `rethrows`.

Oh, I see your point.  Yes, you're right.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list