Generate AsyncEnumerableDeprecated facade in runtime assembly by idg10 · Pull Request #2293 · dotnet/reactive (original) (raw)

The initial fix for #2291 created a new problem: any code that continued to use the deprecated methods still available on System.Linq.Async would now expect them to exist on a type called AsyncEnumerableDeprecated. (That's where the reference assembly defines them, in order to avoid defining a duplicate AsyncEnumerable class that would clash with .NET 10's.)

But for binary compatibility with code that has not been compiled against Ix.NET's System.Linq.Async v7, the runtime assembly must continue to provide the whole historical AsyncEnumerable API in a class called AsyncEnumerable.

So the deprecated methods that remain visible in System.Linq.Async now need to appear in two places in the runtime assembly:

This adds a code generator that generates AsyncEnumerableDeprecated as a facade in the runtime assembly, forwarding all of the necessary methods to their original AsyncEnumerable counterparts.