fork download
  1. using System;
  2.  
  3. class MyClass
  4. {
  5. }
  6.  
  7. class Program
  8. {
  9. public static void SomeFunction<T>()
  10. {
  11. Console.WriteLine("Called SomeFunction with type parameter " + typeof(T));
  12. }
  13.  
  14. public static void Main()
  15. {
  16. SomeFunction<int>();
  17. SomeFunction<float>();
  18. SomeFunction<object>();
  19. SomeFunction<string>();
  20. SomeFunction<MyClass>();
  21. }
  22. }
Success #stdin #stdout 0.02s 14504KB
stdin
Standard input is empty
stdout
Called SomeFunction with type parameter System.Int32
Called SomeFunction with type parameter System.Single
Called SomeFunction with type parameter System.Object
Called SomeFunction with type parameter System.String
Called SomeFunction with type parameter MyClass