Open
Description
Discussion: #8967
Currently, in an invocation of a generic method, you either have to specify all of the type arguments or none of them, in the latter case depending on the compiler to infer them for you. The proposal is to permit the programmer to provide some of the type arguments, and have the compiler infer only those that were not provided.
There are (at least) three possible forms this could take:
- Named type arguments (Discussion: Named type arguments #280, Proposal: Allow partial generic specification #1348), e.g.
M<TElement: int>(args)
- Omitted type arguments separated by commas, e.g.
M<int, >(args)
- Types to be inferred specified by
var
(Proposal: Allow partial generic specification #1348), e.g.M<int, var>(args)