Proposal: Support generics and generic type parameters in aliases #90
-
Copied from dotnet/roslyn#3993 I propose the following changes to aliases to support generics:
* There's probably a better item in the spec for this. The purpose of this proposal is to allow aliases to be defined for unbound or partially bound generic types where the alias is then treated as a generic type that must be closed at the point at which it is used. For example the following is legal in C# today:
This expansion would permit the following:
The name of the generic type parameter can be anything. The arguments are matched by their position in the aliased type.
When consuming the alias the rules would apply the same as when consuming a generic type:
Arguments:
Complications:
The rules for aliases today already solves this problem by not permitting an alias to refer to itself or another alias. If that weren't the case this scenario would already be problematic: This is true. Given the
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Shouldn't this issue be closed? It's the same as #1239, which also includes the original comments from the roslyn repo. |
Beta Was this translation helpful? Give feedback.
Shouldn't this issue be closed? It's the same as #1239, which also includes the original comments from the roslyn repo.