title: Implicit returns from single-expression closures in swift playground
body: <p>According to THE Swift book from Apple, instead of</p>
  
  <pre><code>let names = ["Chris", "Alex", "Ewa", "Barry", "Daniella"]
  var reversed = sorted(names, { s1, s2 in return s1 &gt; s2 })
  </code></pre>
  
  <p>because the closure's body contains a single expression <em>s1 > s2</em> that returns a Bool, there is no ambiguity, so the <em>return</em> keyword can be omitted:</p>
  
  <pre><code>reversed = sorted(names, { s1, s2 in s1 &gt; s2 })
  </code></pre>
  
  <p>Well, this does not work in Playground.  The error in Playground says <em>Ambiguous use of operator '>'</em>.  </p>
  
  <p><strong>Update</strong>: Similarly, this</p>
  
  <pre><code>reversed = sorted(names, { $0 &gt; $1 })
  </code></pre>
  
  <p>does not work.  Same error.  This</p>
  
  <pre><code>reversed = sorted(names, { return $0 &gt; $1 })
  </code></pre>
  
  <p>does.  </p>
  
  <p><strong>Update 2</strong>: After seeing Mike S's answer, I am convinced the bug might be due to Swift String and NSString.  I tried</p>
  
  <pre><code>let nums = [3, 5, 1, 2, 10, 9]
  var dec = sorted(nums, { n1, n2 in n1 &gt; n2 })
  var inc = sorted(nums, { n1, n2 in n1 &lt; n2 })
  </code></pre>
  
  <p>They all worked with or without the import statement.  The work around for String is not to bad since now we just have to type return when we want to compare String using the > operator.</p>
  
  <p>So what can be the explanation here (have not checked in a normal project)?  </p>