47 references to Add
Microsoft.CodeAnalysis (3)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (2)
445
var updatedCollection = priorCollection.
Add
(key, value);
547
var 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)
28
private static readonly ImmutableSegmentedDictionary<string, Symbol> RequiredMembersErrorSentinel = ImmutableSegmentedDictionary<string, Symbol>.Empty.
Add
("<error sentinel>", null!);
Microsoft.CodeAnalysis.UnitTests (43)
Collections\ImmutableSegmentedDictionaryBuilderTest.cs (13)
57
var set = ImmutableSegmentedDictionary<int, string>.Empty.
Add
(1, "1");
126
var collection = ImmutableSegmentedDictionary<int, string?>.Empty.
Add
(1, null);
172
var 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();
238
var 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");
173
var 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");
209
var exception = Assert.Throws<ArgumentException>(null, () => map.
Add
("firstKey", "3"));
226
IImmutableDictionary<string, int> populated = ImmutableSegmentedDictionary.Create<string, int>().
Add
("a", 5);
237
var populated = ImmutableSegmentedDictionary.Create<string, int>().
Add
("a", 5);
248
ImmutableSegmentedDictionary<string, int> dict = ImmutableSegmentedDictionary.Create<string, int>().
Add
("One", 1).
Add
("Two", 2);
289
clearedDictionary = 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");
348
Assert.True(map.
Add
(key, value).ContainsValue(value));
Collections\SegmentedCollectionsMarshalTests.cs (4)
176
dict = dict.
Add
(1, default);
177
dict = dict.
Add
(2, new Struct() { Value = 1, Property = 2 });
212
dict = dict.
Add
(1, new IntAsObject());
213
dict = dict.
Add
(2, new IntAsObject());