Generate AsyncEnumerableDeprecated facade in runtime assembly #2293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The initial fix for #2291 created a new problem: any code that continued to use the deprecated methods still available on
System.Linq.Asyncwould now expect them to exist on a type calledAsyncEnumerableDeprecated. (That's where the reference assembly defines them, in order to avoid defining a duplicateAsyncEnumerableclass that would clash with .NET 10's.)But for binary compatibility with code that has not been compiled against Ix.NET's
System.Linq.Asyncv7, the runtime assembly must continue to provide the whole historicalAsyncEnumerableAPI in a class calledAsyncEnumerable.So the deprecated methods that remain visible in
System.Linq.Asyncnow need to appear in two places in the runtime assembly:AsyncEnumerable(for binary compatibility)AsyncEnumerableDeprecated(so that code that choses to ignore deprecation warnings still works)This adds a code generator that generates
AsyncEnumerableDeprecatedas a facade in the runtime assembly, forwarding all of the necessary methods to their originalAsyncEnumerablecounterparts.