fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5.  
  6. interface IGenericOrder<out T> where T : new()
  7. {
  8. Func<int,T> GetStatement(string name);
  9. }
  10.  
  11.  
  12. public class GenericOrder<T> : IGenericOrder<T> where T : new()
  13. {
  14. public Func<int,T> GetStatement(string name)
  15. {
  16. return (x) => default(T);
  17. }
  18. }
  19.  
  20. public static void Main()
  21. {
  22. var ord = new GenericOrder<int>();
  23. var n = ord.GetStatement("")(5);
  24. Console.WriteLine(n);
  25. }
  26. }
Success #stdin #stdout 0.04s 23904KB
stdin
Standard input is empty
stdout
0