After C# 12 (.NET 8), all types can be aliased:
using A = int;
using B = string;
using C = Dictionary<int, string>;
However, it cannot be written as
using A = int;
using B = string;
using C = Dictionary<A, B>;
Is this a bug or just a feature? Is there any workaround?
The documentation of the compiler Error CS0246 explains that
A
using
alias directive does not use theusing
directives in the source code file to resolve types.
So, the other aliases defined in the same source code file are not visible while declaring new aliases.