using System; class DelegateFlow { void M1(int i) { } void M2(Action a) { a(0); a = _ => { }; a(0); } void M3() { M2(_ => { }); M2(M1); } void M4(Action a) { M2(a); } void M5() { M4(_ => { }); M4(M1); } void M6(Action> aa, Action a) { aa(a); } void M7() { M6(a => { a(1); }, M1); } Action Prop { get { return _ => { }; } set { value(0); } } void M8() { dynamic d = this; d.Prop = d.Prop; } static Func> F = () => _ => { }; void M9() { F()(0); } Action M10() { return _ => { }; } void M11() { M10()(0); } public delegate void EventHandler(); public event EventHandler Click; public void M12() { Click += M11; Click(); M13(M9); } public void M13(EventHandler eh) { Click += eh; Click(); } public void M13() { void M14(MyDelegate d) => d(); M14(new MyDelegate(M9)); M14(new MyDelegate(new MyDelegate(M11))); M14(M12); M14(() => { }); } public void M14() { void LocalFunction(int i) { }; M2(LocalFunction); } public void M15() { Func f = () => 42; new Lazy(f); f = () => 43; new Lazy(f); } public delegate void MyDelegate(); }