From 7f777f3d4c1c5e74e0a2386ea1953bacecdc6578 Mon Sep 17 00:00:00 2001 From: lilinus Date: Thu, 8 Aug 2024 12:00:59 +0200 Subject: [PATCH] Fix some NRT on StringCollections --- .../ref/System.Collections.Specialized.cs | 4 ++-- .../src/System/Collections/Specialized/StringCollection.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs b/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs index b91fe8eb10820..c5bce875fe9b7 100644 --- a/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs +++ b/src/libraries/System.Collections.Specialized/ref/System.Collections.Specialized.cs @@ -213,10 +213,10 @@ public StringCollection() { } bool System.Collections.IList.IsReadOnly { get { throw null; } } object? System.Collections.IList.this[int index] { get { throw null; } set { } } public int Add(string? value) { throw null; } - public void AddRange(string[] value) { } + public void AddRange(string?[] value) { } public void Clear() { } public bool Contains(string? value) { throw null; } - public void CopyTo(string[] array, int index) { } + public void CopyTo(string?[] array, int index) { } public System.Collections.Specialized.StringEnumerator GetEnumerator() { throw null; } public int IndexOf(string? value) { throw null; } public void Insert(int index, string? value) { } diff --git a/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/StringCollection.cs b/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/StringCollection.cs index ff0cba7fc19f4..b27aebf5de628 100644 --- a/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/StringCollection.cs +++ b/src/libraries/System.Collections.Specialized/src/System/Collections/Specialized/StringCollection.cs @@ -69,7 +69,7 @@ public int Add(string? value) /// /// Copies the elements of a string array to the end of the . /// - public void AddRange(string[] value) + public void AddRange(string?[] value) { ArgumentNullException.ThrowIfNull(value); @@ -99,7 +99,7 @@ public bool Contains(string? value) /// Copies the values to a one-dimensional instance at the /// specified index. /// - public void CopyTo(string[] array, int index) + public void CopyTo(string?[] array, int index) { data.CopyTo(array, index); }