Weird behaviour of c# compiler due caching delegate
问题 Suppose I have following program: static void SomeMethod(Func<int, int> otherMethod) { otherMethod(1); } static int OtherMethod(int x) { return x; } static void Main(string[] args) { SomeMethod(OtherMethod); SomeMethod(x => OtherMethod(x)); SomeMethod(x => OtherMethod(x)); } I cannot understand compiled il code (it uses too extra code). Here is simplified version: class C { public static C c; public static Func<int, int> foo; public static Func<int, int> foo1; static C() { c = new C(); } C(){