Fall-Through switch statements in C#

Everybody's been told C# switch statements don't support fall-through, this is a fallacy.


var foo=true;
switch (foo)
{
    case true:
        Console.Out.WriteLine("Bools have 3 values: True");
        goto case false;
    case false:
        Console.Out.WriteLine("False");
        goto default;
    default:
        Console.Out.WriteLine("FileNotFound");
        break;
}


I feel dirty.


3 comments:

Please leave your comments in English or French and I will be pleased to answer them if you have any questions.

Spammers will be walked down the plank matey. Arrr!