我不明白为什么它的工作...
class Program
{
static void Main(string[] args)
{
IComparable.Equals(12, 3);
}
}
IL代码:
.method private hidebysig static void Main(string[] args) cil managed
{
.entrypoint
// Code size 21 (0x15)
.maxstack 8
IL_0000: nop
IL_0001: ldc.i4.s 12
IL_0003: box [mscorlib]System.Int32
IL_0008: ldc.i4.3
IL_0009: box [mscorlib]System.Int32
IL_000e: call bool [mscorlib]System.Object::Equals(object,
object)
IL_0013: pop
IL_0014: ret
} // end of method Program::Main
它编译为 bool Object.Equals(Object,Object),但为什么呢?