I\'m wrestling with a weird, at least for me, method overloading resolution of .net. I\'ve written a small sample to reproduce the issue:
class Program
{
I agree with Jon Skeet's answer - refer to his post (above) on Jan 11 at 17:32. To expand further, please refer to C# language specification - page: 110
6.1.3 Implicit enumeration conversions An implicit enumeration conversion permits the decimal-integer-literal 0 to be converted to any enum-type and to any nullable-type whose underlying type is an enum-type. In the latter case the conversion is evaluated by converting to the underlying enum-type and wrapping the result (§4.1.10).
Still there is a problem:
adding the statement:
test.Execute(-0.0); //object overload: 0
while adding the following:
test.Execute(+0.0); //enum overload: 0
Jacques Colmenero Enterprise Architect colmeneroj@videotron.ca