This is definitely not ambiguous if you use x+1 , since the type of the first argument is then int . (There is no byte+byte operator in C #.)
In the first case, you have a byte argument, which can be implicitly converted to int , but then an integer literal. The argument is of type int , but with an implicit conversion of the constant expression to byte (see Section 6.1.9). Therefore, when both Min(byte, byte) and Min(int, int) are applicable overloads, each of them is "preferred" for the other parameter (due to the available transformations), therefore, ambiguity.
Note that if you have a βnormalβ expression of type int (as opposed to a constant expression), the uncertainty goes away:
byte x = 200; int y = 10; int z = Math.Min(x, y);
Similarly the usual byte argument:
byte x = 200; byte y = 10; byte z = Math.Min(x, y);
Or you can force the conversion:
byte x = 200; byte z = Math.Min(x, (byte)10);
source share