Replies: 4 comments
-
I think this is pretty much a duplicate of dotnet/roslyn#6207, which was closed as duplicate of #280. |
Beta Was this translation helpful? Give feedback.
-
This is not a dup because it offers |
Beta Was this translation helpful? Give feedback.
-
@gafter The first possibility is a dupe: Removing that from discussion since that part is a dupe, that leaves the I view the void Foo<T1, T2, T3, T4, TResult>(T1 t1, T2 t2, T3 t3, T4 t4)
{
}
Foo<TResult: int>(0, 0, 0, 0); With the void Foo<T1, T2, T3, T4, TResult>(T1 t1, T2 t2, T3 t3, T4 t4)
{
}
Foo<var, var, var, var, int>(0, 0, 0, 0); Given the choice between the two, I'd pick the former. |
Beta Was this translation helpful? Give feedback.
-
Oops, I just saw #1349 - I'll make my comments over there if no one else has covered that. |
Beta Was this translation helpful? Give feedback.
-
If the compiler is not able to infer all the generic type arguments on a call, you must specify all of them. I propose adding a way to let the compiler infer all is can, and only require the source code to specify the not inferrable type arguments.
This is particularly useful when the type arguments are complex and you only need to specify one type argument of many.
E.g. A cast extension method on a generic IEnumerable<>. This is a trivial example to demonstrate, I know the actual Cast extension works on the non-generic IEnumerable.
Beta Was this translation helpful? Give feedback.
All reactions