title: If let var - Unwrapping optional value
body: <p>There is some ways to unwrap an optional value:</p>
  
  <pre><code>// 1st way
  var str: String? = "Hello, playground"
  if let strUnwrapped = str {
      // strUnwrapped is immutable
      println(strUnwrapped)
  }
  
  // 2nd way
  var str: String? = "Hello, playground"
  if var strUnwrapped = str {
      // strUnwrapped is mutable
      strUnwrapped = "Toldino"
      println(strUnwrapped)
  }
  </code></pre>
  
  <p>But I recently test this following one...</p>
  
  <pre><code>// The strangest one
  var str: String? = "Hello, playground"
  if let var strUnwrapped = str {
      // strUnwrapped is mutabe
      strUnwrapped = "yolo"
      println(strUnwrapped)
  }
  </code></pre>
  
  <p>Can you explain me why does it work ?
  It is a bug or a functionality ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>As <a href="https://stackoverflow.com/users/1904287/ni%C3%B1oscript">niñoscript</a> said, it was a bug.</p>
  
  <p>It is resolved in Swift 2.0, I tried it with the new version and it doesn't compile anymore.</p>
  
  <p>Now Xcode throw this following error for "if let var"
  <img src="https://i.stack.imgur.com/eYdoA.png" alt="xcode error"></p>