[Mono-list] Helo in switch-case:

Gaurav Vaish gvaish@iitk.ac.in
Sun, 17 Mar 2002 13:32:06 +0530

Thanks a lot.
    The discussion helped me.

The Buggy Me!

----- Original Message -----
From: "Miguel de Icaza" <miguel@ximian.com>
To: "Gaurav Vaish" <gvaish@iitk.ac.in>
Cc: <mono-list@ximian.com>; "John Barnette" <jbarn@httcb.net>
Sent: Saturday, March 16, 2002 13:55
Subject: Re: [Mono-list] Helo in switch-case:

: > : Even default: labels must have a break in C#, I believe.
: >
: >     On the contrast, my "break" statements are redundant. C# does not
believe in
: > "break" - it does it by default. This is in exactly opposite direction with
: > we have in other languages (C/C++/Java) where the flow is automatically
: > transferred to next label if no break if found.
: >
: >     In C#, whether or not break is there, the control is transferred to the
: > of the block. So, applying break to default may not help.
: Breaks are required as John pointed out in C# even on the default case,
: because your code can look like this:
: switch (x){
: default: ...
: case 1:
: }
: >     Miguel - what implementation do we have in our mcs for this? This is
: > to be a critical point -- applying a "break" even after the last option, I
: > making it a total must. I hate that.
: It is part of the spec, so MCS will do the same thing MS C# does.
: Currently, I do not perform any flow analysis, so you *might* get away
: with not putting a final break, but that will change ;-)
: Miguel.