title: Swift - Declaring a Set using named variable
body: <p>I am trying to understand Sets in Swift and how to declare them correctly but I have found the following a little confusing.</p>
  <p>I understand that this works:</p>
  <pre><code>let elements = [ 1, 2, 3, 4, 5, 1, 2, 6, 7]
  let setFromElements = Set(elements)
  </code></pre>
  <p>But I don't understand why the following doesn't:</p>
  <pre><code>let setFromElements : Set = elements
  </code></pre>
  <p>Or even:</p>
  <pre><code>let setFromElements : Set&lt;Int&gt; = elements
  </code></pre>
  <p>When the following is valid:</p>
  <pre><code>let setFromArray : Set = [ 1, 2, 4, 5]
  </code></pre>
  <p>Can someone please help me understand why this is the case?</p>