The following code
long? long1 = 1;
long? long2 = 2;
Math.Min(long1.Value, long2);
will result in the following error message on both arguments:
I understand why this is an error, I know how to resolve the error.
My question is why is the compiler trying to choose the Math.Min(sbyte, sbyte) overload in this case (even when the first argument is not a nullable)?
It can't find the right overload, so it defaults to the first one in Math.cs, which happens to be public static sbyte Min(sbyte val1, sbyte val2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With