Skip to content

Commit 66e45ef

Browse files
Fix some NRT on StringCollections (#106116)
Co-authored-by: Eirik Tsarpalis <[email protected]>
1 parent 0148ed5 commit 66e45ef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,10 @@ public StringCollection() { }
213213
bool System.Collections.IList.IsReadOnly { get { throw null; } }
214214
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
215215
public int Add(string? value) { throw null; }
216-
public void AddRange(string[] value) { }
216+
public void AddRange(string?[] value) { }
217217
public void Clear() { }
218218
public bool Contains(string? value) { throw null; }
219-
public void CopyTo(string[] array, int index) { }
219+
public void CopyTo(string?[] array, int index) { }
220220
public System.Collections.Specialized.StringEnumerator GetEnumerator() { throw null; }
221221
public int IndexOf(string? value) { throw null; }
222222
public void Insert(int index, string? value) { }

src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/StringCollection.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public int Add(string? value)
6969
/// <devdoc>
7070
/// <para>Copies the elements of a string array to the end of the <see cref='System.Collections.Specialized.StringCollection'/>.</para>
7171
/// </devdoc>
72-
public void AddRange(string[] value)
72+
public void AddRange(string?[] value)
7373
{
7474
ArgumentNullException.ThrowIfNull(value);
7575

@@ -99,7 +99,7 @@ public bool Contains(string? value)
9999
/// <para>Copies the <see cref='System.Collections.Specialized.StringCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the
100100
/// specified index.</para>
101101
/// </devdoc>
102-
public void CopyTo(string[] array, int index)
102+
public void CopyTo(string?[] array, int index)
103103
{
104104
data.CopyTo(array, index);
105105
}

0 commit comments

Comments
 (0)