fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5.  
  6. class SomeClass {
  7. }
  8. interface IInterface<T> where T : SomeClass {
  9. void InterfaceMethod();
  10. }
  11. abstract class InterfaceImpl<T> : IInterface<T> {
  12. public abstract void InterfaceMethod();
  13. }
  14.  
  15. public static void Main()
  16. {
  17. // your code goes here
  18. }
  19. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(11,20): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `Test.IInterface<T>'. There is no boxing or type parameter conversion from `T' to `Test.SomeClass'
prog.cs(8,23): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty