Skip to content

Incorrect code generation in Async Iterator for combinedTokens #81467

@henriquewr

Description

@henriquewr

Version Used: dotnet 10 (the bug exists since the code was written back in 2019)

The issue occurs when calling GetAsyncEnumerator multiple times, then the combinedTokens field is overriden and looses the reference of the previous value making it not beeing disposed properly

Steps to Reproduce:

Thats the repo for reproducing the bug: https://github.com/henriquewr/RoslynAsyncIteratorBugRepro

Expected Behavior:
All Linked Tokens should be disposed

Actual Behavior:
Only the last token is disposed

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions