Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision |
rfc:switch_expression [2020/03/28 10:52] – Minor rewording ilijatovilo | rfc:switch_expression [2020/03/28 11:31] – Minor rewording ilijatovilo |
---|
</code> | </code> |
| |
The fallthrough behavior can't reasonably be changed in the ''switch'' statement because it would break a lot of code. However this RFC porposes allowing multiple conditions per ''case'' so that the intention of running the same code can be expressed more clearly. The ''switch'' expression resolves this issue exactly as described above. There is an implicit ''break'' added after each ''case''. Like with the statement multiple ''case'' conditions can be separated by a '',''. | The fallthrough behavior can't reasonably be changed in the ''switch'' statement because it would break a lot of code. However this RFC porposes allowing multiple conditions per ''case'' so that the intention of running the same code can be expressed more clearly. The ''switch'' expression resolves this issue exactly as described above. There is an implicit ''break'' added after each ''case''. Like with the statement multiple ''case'' conditions can be separated by a comma. |
| |
==== Inexhaustiveness ==== | ==== Inexhaustiveness ==== |