Non-exhaustive 'when' without 'else' used in expression is an error regardless of expected type: it can't be an expression, even of type Unit.
regardless of expected type: it can't be an expression, even of type Unit. #KT-10139 Fixed