using System; using System.Linq.Expressions; class Foo { int ThisMethod () { return 33; } public int Goo (bool hoo) { bool local_hoo = hoo; Expression> a = () => hoo; if (a.Compile ()()) return 1; if (true) { Expression> b = () => local_hoo; if (b.Compile ()()) return 2; } Expression> c = () => ThisMethod (); if (c.Compile ()() != 33) return 3; Console.WriteLine ("OK"); return 0; } public static int Main () { var f = new Foo (); return f.Goo (false); } }