Re: [swift-users] Compiler refuses non-escaping closure calls in nested function: Bug?

2016-10-10 Thread Zhao Xin via swift-users
> It is just like there were two ways to do the job, you thought it worked in this way, but it chose the other way. Both ways lead to the same result. I think it is because the compiler **flatten** your inner function instead of calculated the result. The variable scope of `closure` is outside th

Re: [swift-users] Compiler refuses non-escaping closure calls in nested function: Bug?

2016-10-10 Thread Jean-Denis Muys via swift-users
It seems to me you are shooting while blindfolded. > I changed you code `let result = closure(n)` to `let result = closure(1)`. I > thought that should eliminate the error. It didn't. The compiler asked me to > change the whole code as below: Why did you expect changing which argument to send