Description:
It would be great to have also match expressions, similar to match statements, where each branch has to return a value (of the same type), which can then be used. It would also be great to introduce a syntax that one can omit the curly braces if only a value is returned.
Description: It would be great to have also
match
expressions, similar to match statements, where each branch has to return a value (of the same type), which can then be used. It would also be great to introduce a syntax that one can omit the curly braces if only a value is returned.Example from here. Instead of
one could write:
This idea is mainly coming from Java's switch expressions.
Suggested Labels:
Code sample that shows issue:
Related Issues: