Replace outdated Array.Empty comments with correct reason#123862
Merged
stephentoub merged 5 commits intomainfrom Feb 2, 2026
Merged
Replace outdated Array.Empty comments with correct reason#123862stephentoub merged 5 commits intomainfrom
stephentoub merged 5 commits intomainfrom
Conversation
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update comment regarding Array.Empty availability
Replace outdated Array.Empty comments with correct reason
Feb 1, 2026
stephentoub
reviewed
Feb 1, 2026
...es/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs
Outdated
Show resolved
Hide resolved
stephentoub
approved these changes
Feb 1, 2026
…ons/Immutable/ImmutableArray_1.Minimal.cs
MihaZupan
approved these changes
Feb 1, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a comment from PR #123854 by updating outdated pragma warning comments that incorrectly stated "Array.Empty() doesn't exist in all configurations" with the actual reason: avoiding the extra generic instantiation for Array.Empty().
Changes:
- Updated pragma warning disable comments in three files to reflect the correct reason for using
new T[0]instead ofArray.Empty<T>()
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/libraries/System.Threading.Tasks.Dataflow/src/Internal/ImmutableArray.cs | Updated CA1825 pragma comment from outdated "doesn't exist in all configurations" to "avoid the extra generic instantiation for Array.Empty()" |
| src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs | Updated CA1825 pragma comment with the same correction |
| src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs | Replaced two-line comment with single-line comment explaining the reason is to avoid extra generic instantiation |
...es/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs
Outdated
Show resolved
Hide resolved
...es/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray_1.Minimal.cs
Outdated
Show resolved
Hide resolved
…ons/Immutable/ImmutableArray_1.Minimal.cs
jkotas
approved these changes
Feb 1, 2026
This was referenced Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses PR #123854 comment: replaces comments citing "Array.Empty() doesn't exist in all configurations" with the actual reason for using
new T[0].Changes
Updated pragma warning comments in 3 files:
System.Diagnostics.DiagnosticSource/Activity.csSystem.Threading.Tasks.Dataflow/Internal/ImmutableArray.csSystem.Collections.Immutable/ImmutableArray_1.Minimal.csBefore:
After:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.