[swift-evolution] [swift-corelibs-dev] Proposal: add `noescape` attribute to public API (particularly libdispatch)

Jacob Bandes-Storch jtbandes at gmail.com
Sat Dec 5 15:44:33 CST 2015


>
> One option was to use the API notes feature of the compiler to annotate
> these APIs as part of the import into Swift. Another is to get the C
> headers changed (on Darwin too) to add the attribute. We may want to do one
> approach in the short term and another in the long term.
>

I've been operating under the assumption that __attribute__((noescape))
will eventually be deeply understood by clang, and allow the same elision
of "self" in Objective-C that @noescape does in Swift. (I filed
<rdar://19914650> for this some time ago.)

Thus, I think it makes the most sense to change the C headers.

However, if swift-corelibs-libdispatch isn't going to affect the Swift
versions that ship with Xcode in the near future, then I guess amending the
API notes is a good idea, so the @noescape versions can get into
developers' hands as soon as possible.

Jacob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151205/8598f3cf/attachment.html>


More information about the swift-evolution mailing list