Skip to content

Document Expression.Block ReadOnlyCollection reuse#12754

Draft
YNan-varamor wants to merge 1 commit into
dotnet:mainfrom
YNan-varamor:docs/expression-block-readonlycollection
Draft

Document Expression.Block ReadOnlyCollection reuse#12754
YNan-varamor wants to merge 1 commit into
dotnet:mainfrom
YNan-varamor:docs/expression-block-readonlycollection

Conversation

@YNan-varamor

Copy link
Copy Markdown

Summary

  • document that Expression.Block overloads accepting IEnumerable can reuse a ReadOnlyCollection
  • warn callers not to mutate the underlying storage after creating the block
  • suggest taking a stable snapshot when the original source can change

Motivation

Addresses #12691. The runtime behavior discussed in dotnet/runtime#128813 is longstanding, so this adds the requested documentation warning rather than changing behavior.

Validation

  • git diff --check
  • parsed xml/System.Linq.Expressions/Expression.xml with PowerShell [xml]

Disclosure

Prepared with assistance from OpenAI Codex.

@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 17, 2026
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jun 17, 2026
@dotnet-policy-service dotnet-policy-service Bot removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 17, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @cston

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Linq.Expressions community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants