fork download
  1. using System;
  2.  
  3. public class Student{}
  4.  
  5. public class Teacher : Student{}
  6.  
  7. public class GenericClassWithTypeConstraints<T1, T2>
  8. where T1 : Student
  9. where T2 : Teacher
  10. {}
  11.  
  12. class Test {
  13. static void Main() {
  14. var obj = new GenericClassWithTypeConstraints<Teacher, Teacher>();
  15. }
  16. }
Success #stdin #stdout 0.01s 33480KB
stdin
Standard input is empty
stdout
Standard output is empty