Announcement

Collapse
No announcement yet.

Array IList bug

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Array IList bug

    array is IList, but method Add fails.
    var arr = new string[3];
    Console.WriteLine(arr is IList);
    IList iarr = (IList)arr;
    iarr.Add("123");
    Console.WriteLine(arr);

  • #2
    Hi,

    It must be failed because Array is fixed size collection.
    https://dotnetfiddle.net/mdgvtt

    Bridge should throw an exception if you try to add an item to the array. So, the bug is that the exception is not thrown.

    Comment


    • #3
      Agree! thanks

      Comment

      Working...
      X