[Solved] Why does the absence of an else block translate to Unit type return for a function?

I can correct this by adding the else clause, but how come if there is no outcome handled by default, the function tries to return a Unit? In Scala, unlike more “imperative” languages, (almost) everything is an expression (there are very few statements), and every expression evaluates to a value (which also means that every … Read more