Your issue is that type alias definitions are not allowed in code blocks. Move the definition to before the class definition.
Alias Any Type in C#12
Shervan360
1,521
Reputation points
Hello,
I want to use the new feature in C#12, but the compiler doesn't know this feature.