-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add more "ref in async" tests #73444
Add more "ref in async" tests #73444
Conversation
@AlekseyTs @cston for reviews, thanks |
|
||
var expectedDiagnostics = new[] | ||
{ | ||
// (6,22): error CS4007: Instance of type 'R' cannot be preserved across 'await' or 'yield' boundary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I will link the issue in a comment. Thanks.
static Task<int> GetInt() => Task.FromResult(42); | ||
|
||
[System.Runtime.CompilerServices.InlineArray(4)] | ||
ref struct Buffer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Span<int> y = new(ref x); | ||
yield return y[0]; | ||
y = new(ref x); | ||
yield return y[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 1)
Test plan: #72662
All remaining tests from the test plan should be covered: