Skip to content
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

Merge "ref in async" feature into main #73488

Merged
merged 8 commits into from
May 15, 2024

Conversation

jjonescz
Copy link
Member

@jjonescz jjonescz commented May 15, 2024

Includes a merge from main into the feature branch (the last commit) with trivial merge conflicts only (in ErrorFacts.cs).

Note: I've also successfully built runtime (clr+libs+libs.tests) with this version of Roslyn locally.

* Warn for `yield return` in `lock`

* Encapsulate utility for filtering diagnostics

* Filter warning for `yield return` in the new `lock`

* Test `yield` in `lock`

* Update existing test

* Revert "Filter warning for `yield return` in the new `lock`"

This reverts commit eafc594.

* Revert "Encapsulate utility for filtering diagnostics"

This reverts commit 654d458.

* Add a comment separating error and warning conditions

* Update tests after removing warning filtering

* Remove runtime-dependent output verification

* Remove unused code from a test
* Allow ref-like locals in iterators and async methods

* Return check of ref-like locals in async methods

* Move declaration to block where it's used

* Add todo for improving error message of ERR_SpecialByRefInLambda

* Test `ref` in `await foreach` and iterator

* Extend tests

* Skip incompatible desktop tests

* Test `yield break` in the new `lock`

* Extend tests

* Mark removed unreleased error code as available

* Improve check for ref locals that can be hoisted

* Return error `ERR_BadSpecialByRefIterator`

* Extend tests

* Uncapitalize feature name to be like others

* Use better errors for refs across awaits

* Improve errors for spilled ref locals across awaits

* Replace remaining old error messages

* Return wrongly removed fact condition

* Extend tests

* Report errors close to problematic usage where possible

* Add more tests

* Test foreach on ref local with iterator inside

* Report spill local await boundary errors at their declaration

* Revert accidentally changed test name

* Test ref struct Current of async enumerator
* Allow unsafe blocks in iterators

* Drop duplicate long diagnostic verifications

* Use `nint` in tests to simplify

* Add more tests

* Handle more iterator kinds

* Make unsafe affect only signature, not iterator body

* Fix comments

* Rename method setting or clearing unsafe region

* Improve code

* Fix accessors

* Remove asserts that can fail for invalid code

* Improve tests

* Avoid some langversion errors that would still be errors in newer langversions

* Refactor tests

* Document a breaking change

* Fix theory conditions

* Test non-iterator unsafe contexts in older language versions as well

* Fix tests demonstrating unsafe context in iterators in C# 12

* Improve naming of tests verifying safe context of setters

* Clarify comment

* Fix test name
* Add more "ref in async" tests

* Link langversion diagnostic mismatch issue in more tests

* Test inline array init with awaits
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 15, 2024
@jjonescz jjonescz marked this pull request as ready for review May 15, 2024 12:43
@jjonescz jjonescz requested review from a team as code owners May 15, 2024 12:43
@jjonescz
Copy link
Member Author

cc @AlekseyTs @cston @jaredpar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Feature - Ref/Unsafe in Iterators/Async untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
3 participants