fork download
  1. using System.IO;
  2. using System;
  3.  
  4. class Program // for compilation purposes
  5. {
  6. private static void Main(string[] args)
  7. {
  8. return;
  9. }
  10. }
  11.  
  12.  
  13. public abstract class Emulator<T> where T : Emulator<T>.EmulatorState
  14. {
  15. public abstract class EmulatorState
  16. {
  17. }
  18. public interface IOpcode
  19. {
  20. }
  21. }
  22.  
  23. class Chip8 : Emulator<Chip8.Chip8State>
  24. {
  25. public class Chip8State : EmulatorState
  26. {
  27. }
  28. }
  29.  
  30. abstract class Chip8Opcode<T> : Emulator<T>.IOpcode where T : Chip8.Chip8State
  31. {
  32. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(30,16): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `Emulator<T>'. There is no boxing or type parameter conversion from `T' to `Emulator<T>.EmulatorState'
prog.cs(13,32): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty