3 ms·
> The switch stuff? Without edhaustiveness checking and with inheritance, it's a waste of time. While this isn't possible in the general case, it might be poss
by MaulingMonkey 10y ago
> The switch stuff? Without edhaustiveness checking and with inheritance, it's a waste of time.
While this isn't possible in the general case, it might be possible to write a rule in FxCop (or other static analysis tool) to do this kind of checking for e.g. private or internal base types, or to at least check for all the derived types of the current assembly (or solution assemblies.) It also looks slightly less ugly than else if chains, which seems to be a driving factor behind a lot of C#'s newer syntactic sugar.