title: constant 'result' inferred to have type (), which may be unexpected
body: <pre><code>@IBAction func operate(sender: UIButton) {
     
       if let operation = sender.currentTitle {
           if let result = brain.performOperation(operation) {
      
              displayValue   = result
           }
           else {
              displayValue = 0.0
           }
      
      }
  }
  </code></pre>
  <p>I am new to coding so pardon my coding format and other inconsistencies. I have been trying out the iOS 8 intro to swift programming taught by Stanford university and I have ran into a problem with the modified calculator.</p>
  <p>I get three errors. The first one is a swift compiler warning - at</p>
  <pre><code>if let result = brain.performOperation(operation)
  </code></pre>
  <p>It says</p>
  <blockquote>
  <p>constant 'result' inferred to have type () which may be unexpected.</p>
  </blockquote>
  <p>It gives me the suggestion to do this ----</p>
  <pre><code>if let result: () = brain.performOperation(operation)
  </code></pre>
  <p>The other two errors are</p>
  <blockquote>
  <p>Bound value in a conditional binding must be of Optional type at if let result line</p>
  <p>Cannot assign a value of type () to a value of Double at &quot;displayValue = result&quot;</p>
  </blockquote>
  <p><a href="https://github.com/abstract45/CalculatorExample1" rel="noreferrer">Here is the github link</a> if anyone needs more information on the code.</p>
  <p>Thanks in advance.</p>