47 references to Add
Microsoft.CodeAnalysis (3)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (2)
445var updatedCollection = priorCollection.Add(key, value); 547var updatedCollection = priorCollection.Add(key, value);
src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2.cs (1)
316=> Add(key, value);
Microsoft.CodeAnalysis.CSharp (1)
Symbols\NamedTypeSymbol.cs (1)
28private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.Add("<error sentinel>", null!);
Microsoft.CodeAnalysis.UnitTests (43)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (13)
57var set = ImmutableSegmentedDictionary<int, string>.Empty.Add(1, "1"); 126var collection = ImmutableSegmentedDictionary<int, string?>.Empty.Add(1, null); 172var map = ImmutableSegmentedDictionary.Create<string, int>().Add("five", 5); 182.Add("a", "1").Add("B", "1").ToBuilder(); 206.Add("a", "1").Add("A", "1").ToBuilder(); 218.Add("a", "1").Add("A", "2").Add("b", "3").ToBuilder(); 226.Add("a", "1").Add("B", "1").ToBuilder(); 238var populated = ImmutableSegmentedDictionary.Create<string, int>().Add("a", 5).ToBuilder();
Collections\ImmutableSegmentedDictionaryTest.cs (26)
40.Add("Johnny", "Appleseed") 41.Add("JOHNNY", "Appleseed"); 55.Add("Johnny", "Appleseed") 56.Add("JOHNNY", "Appleseed"); 173var map = ImmutableSegmentedDictionary.Create<string, string>().Add("a", "1").Add("B", "1"); 191.Add("a", "1").Add("A", "1"); 200.Add("a", "1").Add("A", "2").Add("b", "3"); 208.Add("firstKey", "1").Add("secondKey", "2"); 209var exception = Assert.Throws<ArgumentException>(null, () => map.Add("firstKey", "3")); 226IImmutableDictionary<string, int> populated = ImmutableSegmentedDictionary.Create<string, int>().Add("a", 5); 237var populated = ImmutableSegmentedDictionary.Create<string, int>().Add("a", 5); 248ImmutableSegmentedDictionary<string, int> dict = ImmutableSegmentedDictionary.Create<string, int>().Add("One", 1).Add("Two", 2); 289clearedDictionary = clearedDictionary.Add("a", 1); 297.Add("a", "1").Add("b", "2"); 307.Add("a", "1") 308.Add("b", "2"); 320.Add("a", "1") 321.Add("b", "2"); 348Assert.True(map.Add(key, value).ContainsValue(value));
Collections\SegmentedCollectionsMarshalTests.cs (4)
176dict = dict.Add(1, default); 177dict = dict.Add(2, new Struct() { Value = 1, Property = 2 }); 212dict = dict.Add(1, new IntAsObject()); 213dict = dict.Add(2, new IntAsObject());