class M { public static int Main () { new SomeGenericClass().FailsToCompile (); return 0; } } class SomeGenericClass { object someValue; delegate void SomeHandlerType (); void Invoke (SomeHandlerType h) { h (); } public void FailsToCompile () { Invoke (delegate { object someObject = 1; Invoke (delegate { someValue = someObject; }); }); } }