- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.2k
Closed
Labels
area-System.Collectionsbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
I encountered the following issue while adapting the new generic OrderedDictionary to STJ's JsonObject type:
[Fact]
public static void OrderedDictionary_SetAt_Bug()
{
    var dict = new OrderedDictionary<int, int>
    {
        [0] = 0
    };
    dict.SetAt(index: 0, key: 42, value: 42);
    Assert.Equal(1, dict.Count);
    Assert.Equal([new(42, 42)], dict);
    Assert.False(dict.ContainsKey(0));
    Assert.True(dict.ContainsKey(42)); // Fails
}Metadata
Metadata
Assignees
Labels
area-System.Collectionsbugin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged