Hi all,

I'm in the process of implementing SE-0035, which limits capturing inout
parameter to @noescape contexts. The proposal is clear on capture behavior for
the following:

1. closure literals
2. nested function passed as arguments.

But I'm not sure what to do with this case, in which 'x' escapes.

func captureAndEscape(inout x: Int) -> () -> Void { func foo()
{ _ = x } return foo }

The most obvious answer is it should be considered with the same rule as
a closure literal, but a nested function can not have @noescape in its type
(for now anyways).

So, should this be legal, then? If not, where/how should the error be? 


_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to