fork download
  1. interface IGen {}
  2. class Gen<T> : IGen where T : class { }
  3. class MoreGen<G> where G : IGen { }
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. new MoreGen<Gen<string>>(); // OK
  10. new MoreGen<Gen<Test>>(); // OK
  11. // new MoreGen<string>(); // no implicit reference conversion from `string' to `IGen'
  12. // new MoreGen<Gen<int>>(); // The type `int' must be a reference type
  13. }
  14. }
Success #stdin #stdout 0.01s 23144KB
stdin
Standard input is empty
stdout
Standard output is empty