fork download
  1. using System;
  2.  
  3. public interface I1 { void i1(); }
  4. public interface I2 { void i2(); }
  5.  
  6. class C : I1, I2
  7. {
  8. public void i1() { Console.WriteLine("I1.i1()"); }
  9. public void i2() { Console.WriteLine("I2.i2()"); }
  10. }
  11.  
  12. public class Test
  13. {
  14. public static void Main()
  15. {
  16. f(new C());
  17. }
  18.  
  19. public static void f<T>(T t)
  20. where T : I1, I2
  21. {
  22. t.i1();
  23. t.i2();
  24. }
  25. }
Success #stdin #stdout 0.02s 33856KB
stdin
Standard input is empty
stdout
I1.i1()
I2.i2()