<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Sep 17, 2014 at 12:10 PM, jahanian <span dir="ltr"><<a href="mailto:fjahanian@apple.com" target="_blank">fjahanian@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Sep 16, 2014, at 5:44 PM, Reid Kleckner <<a href="mailto:rnk@google.com">rnk@google.com</a>> wrote:<br>
<br>
> I mean, there's got to be a way to inject some destructor cleanups into the lambda, like:<br>
><br>
> struct A { ~A(); };<br>
> int f(A) { return 42; }<br>
> id test_dict()<br>
> {<br>
>         return @{<br>
>                 @"a": [x=f(A())]() { return x; },<br>
>                 @"b": [x=f(A())]() { return x; }<br>
>         };<br>
> }<br>
><br>
> Does this change affect where ~A gets called?<br>
><br>
<br>
</span>With John’s suggested patch I sent earlier, cleanup code to effect conversion to block expression is moved to<br>
where outer-most expression (one passed to return) is seen. So, new patch does not affect where ~A<br>
gets called.<br></blockquote><div><br></div><div>Cool, sounds good to me. </div></div></div></div>