Type Inference on Method Return Type
Why does Scala fail to infer the return type of the method when there's explicit `return` statement used in the method?

i.e. Why does the following code compile :
    
    object Main {
      def who = 5
      def main(args: Array[String]) = println(who)
    }
    

...and the following doesn't :

    object Main {
      def who = return 5
      def main(args: Array[String]) = println(who)
    }
Type Inference on Method Return Type
===

Why does Scala fail to infer the return type of the method when there's explicit `return` statement used in the method?

i.e. Why does the following code compile :
    
    object Main {
      def who = 5
      def main(args: Array[String]) = println(who)
    }
    

...and the following doesn't :

    object Main {
      def who = return 5
      def main(args: Array[String]) = println(who)
    }