Trent Nadeau via swift-evolution <swift-evolution@...> writes:

> https://github.com/tanadeau/swift-evolution/blob/make-noescape-
default/proposals/XXXX-make-noescape-default.md

-1 from me.

1. One must break API and ABI compatibility to add @escaping to an 
existing function
2. @nonescaping case is actually quite as common as @escaping
3. Swift's lifetime system is not powerful enough, I'll explain below

Lazy map and filter will be marked as @escaping. Now consider the 
following code:

func sum<T>(_ array: [T], transform: (T) -> Int) -> Int {
    return array.lazy.map(func).reduce(0, combine: +)
}

`transform` will be marked as @escaping, despite that `transform` never 
actually escapes `sum`.

I believe that we should not accept nonescaping-by-default until we get 
a powerful lifetime management system, as in Rust.

I think it makes sense to create a mini-proposal just for renaming of 
@noescape to @nonescaping.

- Anton


_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to