using System; using System.Linq.Expressions; public class Test { public static int Main () { if (Value () != 0) return 1; var v = Value (); return 0; } static T Value () where T : new () { Expression> e = () => new T (); var et = e.Body.NodeType; if (et != ExpressionType.New) throw new ApplicationException (et.ToString ()); return e.Compile ().Invoke (); } }