
Untitled
By: a guest on
May 8th, 2012 | syntax:
None | size: 0.63 KB | hits: 12 | expires: Never
Extension methods and static methods mismatch prototype matching in c# [closed]
using System;
namespace Test
{
static class EM
{
public static string To(this object o)
{
return "2222";
}
}
class A
{
public static string To() { return "1111"; }
}
class B { }
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
object o = null;
o.To();
B b = null;
b.To();
A a = null;
a.To();
A.To();
}
}
}