fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4.  
  5. public class Sample : List<bool> {}
  6.  
  7. public class Program
  8. {
  9. public static void Main()
  10. {
  11. try
  12. {
  13. var a = new List<bool>();
  14. Console.WriteLine(a.GetType().GetGenericArguments()[0]);
  15.  
  16. a = new Sample();
  17. Console.WriteLine(a.GetType().GetGenericArguments()[0]);
  18. }
  19. catch (Exception ex)
  20. {
  21. Console.WriteLine(ex);
  22. }
  23. }
  24. }
Success #stdin #stdout 0s 29800KB
stdin
Standard input is empty
stdout
System.Boolean
System.IndexOutOfRangeException: Array index is out of range.
  at Program.Main () [0x00000] in <filename unknown>:0