Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // valac 0.15.2 complains with ... :7.2-9.31: error: missing break statement at end of switch section
- enum CheckType {
- A, B, C;
- }
- static bool checkIt(CheckType ct, int v)
- {
- switch (ct) // Complains here!!
- {
- case CheckType.A: return true;
- case CheckType.B:
- if (v == 0) break;
- // Fall thru
- case CheckType.C:
- if (v > 3) return false;
- break;
- }
- return true;
- }
- void main(string[] args)
- {
- bool res = checkIt(CheckType.B, args.length);
- stdout.printf("Result is %s\n", res.to_string());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement