title: What is the return type of a scala if statement without else
body: <p>I made a mistake similar to the following in some Scala code:</p>
  
  <pre><code>val someVal:String = if (someX == someY) n
  </code></pre>
  
  <p>In retrospect the mistake is clear to me (it has to assign something to someVal, and if the expression is false, it's probably not going to be a string). I want to know what the value returned would be if the expression is false. My best guess is Unit, or perhaps AnyVal. </p>