I’m having hard time understanding, why the compiler requires using break statement. It’s not possible to miss it since the fall through is now allowed. I see the reason for the break in C or C++, but is it needed here.
Why it’s not a built-in behavior to break after a case is over ? Isn’t it just a syntax with no semantic?
Sorry, if it’s a stupid question.
EDIT: The fall through is allowed only when the case is empty. When there is a statement there you can’t omit the break statement. So, it’s a different matter.
The compiler doesn’t so much ‘need’ the break statements, it demands them.
This was a design decision. It keeps the code semantically close to C and C++ while eliminating the pitfalls of fall-through that was always a debatable ‘feature’ of the C languages.