fork(1) download
  1. using System;
  2.  
  3. class Animal {}
  4. class Giraffe : Animal {}
  5. class Dog : Animal {}
  6.  
  7. public class Test
  8. {
  9. static void Main(string[] args)
  10. {
  11. Giraffe[] giraffes = new Giraffe[5];
  12. giraffes[0] = new Giraffe();
  13. Animal[] animals = giraffes;
  14. animals[1] = new Dog();
  15. }
  16. }
Runtime error #stdin #stdout #stderr 0.02s 36376KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Unhandled Exception: System.ArrayTypeMismatchException: Source array type cannot be assigned to destination array type.
  at (wrapper stelemref) object:virt_stelemref_class (intptr,object)
  at Test.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArrayTypeMismatchException: Source array type cannot be assigned to destination array type.
  at (wrapper stelemref) object:virt_stelemref_class (intptr,object)
  at Test.Main (System.String[] args) [0x00000] in <filename unknown>:0