fork download
  1. using System.Linq;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System;
  5.  
  6. class c
  7. {
  8. public static void Main()
  9. {
  10. var l =
  11. MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(
  12. MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(
  13. MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(
  14. MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(
  15. MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(MakeList(
  16. (object)"",1
  17. ))))))))))))))))))))))))))))))))))))))))))))))))));
  18. Console.WriteLine(l.GetType());
  19. }
  20.  
  21.  
  22. static IEnumerable<Item> MakeList<Item>(Item value, int count)
  23. {
  24. for (int i = 0; i < count; ++i)
  25. yield return value;
  26. }
  27.  
  28. static IEnumerable<Item> MakeList<Item>(Item value)
  29. where Item:IEnumerable
  30. {
  31. foreach(object o in value)
  32. yield return value;
  33. }
  34. }
stdin
Standard input is empty
compilation info
prog.cs(31,24): warning CS0219: The variable `o' is assigned but its value is never used
Compilation succeeded - 1 warning(s)
stdout
c+<MakeList>c__Iterator1`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[System.Object]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]