title: Why does Xcode report "Variable 'tuple.0' used before being initialized" after I've assigned all elements of a Swift tuple?
body: <p>I want to assign the 3 numbers in an array to the 3 elements of a tuple using a <code>for</code> loop. The following function seems to do the trick, but Xcode errors as soon as I try to reference the (seemingly) fully assigned tuple. Am I doing something wrong?</p>
  
  <pre><code>typealias Triple = (Int, Int, Int)
  func createTuple() -&gt; Triple
  {
      var tuple: Triple
      let r = [8, 6, 3]
  
      for i in 0..&lt;r.count {
          switch(i) {
          case 0: tuple.0 = r[i]
          case 1: tuple.1 = r[i]
          case 2: tuple.2 = r[i]
          default : break
          }
      }
      return tuple // Xcode says "Variable 'tuple.0' used before being initialized
  }
  </code></pre>