Why does Swift playground shows wrong number of executions?
<p>I am using a completion handler to sum up numbers. What I don't understand is if I break my code in 2 lines, the number of executions would change from 6 to 7!! WHY?       </p>

<pre><code> func summer (from : Int, to: Int, handler: (Int) -&gt; (Int)) -&gt; Int {
        var sum = 0
        for i in from...to {
            sum += handler(i)
        }
        return sum

}

summer(1, to:6){ //Shows '21'
    return $0} // shows '(6 times)'


// Same code, but in 1 line
summer(1, to:6){return $0} // shows '(7 times)'
</code></pre>

<p><strong>IMAGE</strong>
<a href="https://i.stack.imgur.com/9UO5Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9UO5Y.png" alt="enter image description here"></a></p>