Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>NotSupportedException</code> <em>sounds</em> like it plainly fits, but the documentation clearly states that it should be used for a different purpose. From the MSDN class remarks:</p> <blockquote> <p>There are methods that are not supported in the base class, with the expectation that these methods will be implemented in the derived classes instead. The derived class might implement only a subset of the methods from the base class, and throw NotSupportedException for the unsupported methods.</p> </blockquote> <p>Of course, there's a way in which <code>NotSupportedException</code> is obviously good enough, especially given its common-sense meaning. Having said that, I'm not sure if it's just right.</p> <p>Given the purpose of <a href="http://code.google.com/p/unconstrained-melody/" rel="noreferrer">Unconstrained Melody</a> ...</p> <blockquote> <p>There are various useful things that can be done with generic methods/classes where there's a type constraint of "T : enum" or "T : delegate" - but unfortunately, those are prohibited in C#.</p> <p>This utility library works around the prohibitions using ildasm/ilasm ...</p> </blockquote> <p>... it seems like a new <code>Exception</code> might be in order despite the high burden of proof we justly have to meet before creating custom <code>Exceptions</code>. Something like <code>InvalidTypeParameterException</code> might be useful throughout the library (or maybe not - this is surely an edge case, right?).</p> <p>Will clients need to be able to distinguish this from BCL Exceptions? When might a client accidentally call this using a vanilla <code>enum</code>? How would you answer the questions posed by the accepted answer to <a href="https://stackoverflow.com/questions/195834/what-factors-should-be-taken-into-consideration-when-writing-a-custom-exception-c/196211#196211">What factors should be taken into consideration when writing a custom exception class?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload