what is the context in swift?
<p>I am new in swift . let' try to understand <code>closures</code><br>
declare a function like closures:</p>

<pre><code>let sayHello = {
  return "hello"
}
</code></pre>

<blockquote>
  <p>unable to infer closures return type of current context ()->()</p>
</blockquote>

<p>My question is here what is the context ?</p>

<pre><code>let sayHello : String  = {
      return "hello"
    }
</code></pre>

<blockquote>
  <p>Function produce expected type of "string" , did you mean to  call it  with ()</p>
</blockquote>

<p>honestly i did not understand this error ?  anyone help me to understand and why need to specify this one  <code>()</code></p>

<p>however . this is working fine and without error it is called closures </p>

<pre><code> let sayHello : String  = {
          return "hello"
        }() 
</code></pre>

<p>thank you </p>