Bugzilla – Bug 318019
Problem with switch and break
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by bmaurer@users.sf.net 2005-05-17 13:47:49 MST ---- using System; class X { static bool A = true; static char c = 'e'; static void Main () { switch (c) { case 'e': if (A) break; return; default: return; } Console.WriteLine ("Good"); } } mcs compiled binary outputs nothing. It should output good. ---- Additional Comments From bmaurer@users.sf.net 2005-05-17 13:53:49 MST ---- This looks like it is for Martin. the compiler thinks the CWL is unreachable, and it is not emitted: IL_0000: ldsfld char X::c IL_0005: stloc.0 IL_0006: ldloc.0 IL_0007: ldc.i4.s 0x65 IL_0009: beq IL_0013 IL_000e: br IL_0023 IL_0013: ldsfld bool X::A IL_0018: brfalse IL_0022 IL_001d: br IL_0024 IL_0022: ret IL_0023: ret IL_0024: ret ---- Additional Comments From bmaurer@users.sf.net 2005-05-17 14:36:01 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO74978 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"