Skip to content

Add an example of using UnscopedRefAttribute to fix CS8170 #47078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025

Conversation

BartoszKlonowski
Copy link
Contributor

@BartoszKlonowski BartoszKlonowski commented Jul 2, 2025

This pull request fixes #46499
It adds the example of how UnscopedRefAttribute can be used to mark a method through which a ref is allowed to escape the scope.

I didn't add the "See also" section with a link to this attribute, because it is already linked twice when mentioned.


Internal previews

📄 File 🔗 Preview link
docs/csharp/language-reference/compiler-messages/cs8170.md Compiler Error CS8170

@BartoszKlonowski BartoszKlonowski requested review from BillWagner and a team as code owners July 2, 2025 19:08
@dotnetrepoman dotnetrepoman bot added this to the July 2025 milestone Jul 2, 2025
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks again @BartoszKlonowski

I had a couple questions to look at before we merge this. Let me know your thoughts.

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

Thanks @BartoszKlonowski

This LGTM now. I'll :shipit: as soon as the build finishes.

@BillWagner BillWagner enabled auto-merge (squash) July 7, 2025 12:52
@BillWagner BillWagner merged commit 92454c8 into dotnet:main Jul 7, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CS8170 Should Mention the ability to use [UnscopedRef] and explain the implications.
2 participants