title: Optional function in Swift with return type
body: <p>I do have a function with an optional return type. I am confused by its produced output. The code goes like this.</p>
  
  <pre><code>func displayAge(age: Int) -&gt; Int? {
      return 23
  }
  
  if var age = displayAge(age: 22) {
      print("Age is correct")
  } else {
      print("Age is incorrect")
  }
  </code></pre>
  
  <p>I passed the age as 22 and I should get a output as Age is incorrect but I am getting Age is correct</p>