Skip to content

Conversation

RikkiGibson
Copy link
Member

Doc for upcoming breaking change

See dotnet/roslyn#80684. TensorShape's constructor was the only break I found when compiling the libraries. I fixed this by extracting the collection-expression to the top level.

@Copilot Copilot AI review requested due to automatic review settings October 15, 2025 21:02
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses an upcoming breaking change in C# related to the safe-context rules for span-valued collection expressions. The change modifies how collection expressions for Span/ReadOnlySpan types are handled when passed to constructors or methods.

Key Changes:

  • Extracts a span-valued collection expression from within a conditional block to the top level of the method to comply with new safe-context rules

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-numerics
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@tannergooding tannergooding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

We probably need to backport this, since the local lifetime is incorrect without this change.

It would be nice if Roslyn could generate slightly better IL as well, but that's separate

@RikkiGibson
Copy link
Member Author

/backport to release/10.0

Copy link
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/18543984013

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants