I have an extension Array
in the form of:
extension Array
{
private func someFunction(someClosure: (() -> Int)?)
{
// Do Something
}
func someOtherFunction(someOtherClosure: () -> Int)
{
someFunction(someClosure: someOtherClosure)
}
}
But I'm getting the error: Passing non-escaping parameter 'someOtherClosure' to function expecting an @escaping closure
.
Both closures are indeed non-escaping (by default), and explicitly adding @noescape
to someFunction
yields a warning indicating that this is the default in Swift 3.1.
Any idea why I'm getting this error?