on Wed Mar 23 2016, Chris Lattner <[email protected]> wrote:
>> On Mar 21, 2016, at 9:37 AM, Jordan Rose via swift-evolution >> <[email protected]> wrote: >> >> -1 for the signature change. The most common case of autoreleasepool >> does not return a value and has a multi-statement body that prevents > >> the result type from being inferred. This needs to continue to work: >> >> autoreleasepool { >> foo() >> bar() >> } >> >> If we had a rule to default generic return values to Void if they >> aren't used then I'd be okay with it, but that'd be a separate >> proposal. (Providing two overloads may also work; haven't tested >> it.) > > I understand that Jordan withdrew his objection later (because no > overload is required) but it still isn't clear to me that > autoreleasepool should return a value. > > Here’s my thought process: autoreleasepool is *intentionally* looking > like a statement, not an expression. I guess there's no arguing with the intention here, because autoreleasepool in the library predates me on the project, but it's worth asking: why is it a good thing for autoreleasepool to be like a statement and not like an expression? As far as I can tell that just makes it less useful and more cumbersome. It is also an illusion that breaks down at the edges, so why try to maintain it? -- Dave _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
