New rule: Async methods with yield statements should have a decorated cancelation token
Fixes #6003
As proposed at the community, when having an async yielding method, the cancellation token should exist and be decorated. #6003
async IAsyncEnumerable<int> Yields([EnumeratorCancellation] CancellationToken token)
{
yield return 13;
}
As far as I know, this can not be achieved in VB.NET as the compiler forbids to have both the Async and the Iterator modifier on an method.
Hi @Corniel, can you please open an issue first with the usual rule specification proposal?
VB.NET doesn't have yield so it should not be relevant there as you've mentioned.
Hi @Corniel, can you please open an issue first with the usual rule specification proposal?
VB.NET doesn't have yield so it should not be relevant there as you've mentioned.
I was hoping the reporter would do that, but it seems pretty silent from there.