2 using System.Linq.Expressions;
6 public static int Main ()
8 if (Value<int> () != 0)
11 var v = Value<Test> ();
15 static T Value<T> () where T : new ()
17 Expression<Func<T>> e = () => new T ();
18 var et = e.Body.NodeType;
19 if (et != ExpressionType.New)
20 throw new ApplicationException (et.ToString ());
22 return e.Compile ().Invoke ();