Richard Touver's answer is excellent, but I thought I would add a little to it.
As other answers pointed out, the reason for this behavior is (1) zero, convertible to any enumeration, and, obviously, for an object, and (2) any type of enumeration is more specific for this enumeration, therefore the method that accepts the enumeration is therefore selected using permission overloading as the best method. Point two - I hope that I myself will explain, but what explains the first point?
Firstly, there is an unsuccessful deviation from the specification. The specification states that any literal zero, i.e. The number 0 , which is actually literally displayed in the source code, can be implicitly converted to any type of enumeration. The compiler actually implements that any constant zero can be converted in this way. The reason for this is due to an error due to which the compiler sometimes allows constant zeros, and sometimes not, in a strange and inconsistent manner. The easiest way to solve the problem was to consistently allow constant zeros. You can read more about this here:
http://blogs.msdn.com/b/ericlippert/archive/2006/03/28/the-root-of-all-evil-part-one.aspx
Secondly, the reason for converting zeros to any enumeration is that it is always possible to clear the βflagβ of an enumeration. Good programming practice is that each enumeration of flags has a value of None, which is zero, but this is a rule, not a requirement. C # 1.0 designers thought it looked weird that you might have to say
for (MyFlags f = (MyFlags)0; ...
to initialize local. My personal opinion is that this solution caused more problems than it cost, both from the point of view of sadness over the aforementioned error, and from the point of view of the oddities that it introduces in detecting the overload that you found.
Finally, the designers of the designers could understand that this would be a problem in the first place, and made overload signatures so that the developer could clearly decide which ctor to call without inserting a role. Unfortunately, this is a rather obscure problem, and therefore many designers are not aware of this. Hope anyone reading this will not make a mistake; Do not create ambiguities between an object and any enumeration if you intend for the two overrides to have different semantics .