Earlier quoted context omitted.
> int result = some_variable switch { a => callAFunctionReturningVoid(); 1, b => 2, }; What does it even mean? Multi-statement lambdas without return statement, I get it, but what is the return value? And returning a void to int? How is it all supposed to work? What the trailing comma means? Inconsistent way of dealing with things that may confuse developers just results in that proposal resisted.
It is not a lambda but a switch expression. The tricky bits here are separating a call and the returned expression with ;. The trailing comma is just sugar to allow for another case
> The expression is the body of the function, the last expression of which generates a return value. Examples of valid lambda expressions include the following:
https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...