title: Swift - "unexpected non-void return value in void function"
body: <p>I've begun writing a user class that has a method for calculating the user's distance from an object. It looks like this:</p>
  <pre><code>class User{
      var searchRadius = Int()
      var favorites : [String] = []
      var photo = String()
      var currentLocation = CLLocation()
  
      func calculateDistance(location: CLLocation){
          let distance = self.currentLocation.distanceFromLocation(location)*0.000621371
          return distance //Error returns on this line
      }
  }
  </code></pre>
  <p>At the line marked above, I get the following error:</p>
  <pre class="lang-none prettyprint-override"><code>(!) Unexpected non-void return value in void function
  </code></pre>
  <p>I've looked elsewhere for a solution, but can't seem to find anything that applies to this instance.  I've used the <code>distanceFromLocation</code> code elsewhere, and it's worked okay, so I'm not sure what's different about the usage in this case.</p>