[swift-evolution] [Review] SE-0061: Add Generic Result and Error Handling to autoreleasepool()

Ben Rimmington me at benrimmington.com
Sat Apr 23 14:02:20 CDT 2016


+1. I believe the proposal should be accepted.

However, cross-platform libraries would still need to write:

#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
    import func ObjectiveC.autoreleasepool
    func autoreleasepool<Result>(
        @noescape body: () throws -> Result
    ) rethrows -> Result {
        return try body()

Charles Srstka suggested an @autoreleasepool attribute:


-- Ben

More information about the swift-evolution mailing list