Writing this function:
static TResult reduce<TSource, TResult>(ParallelQuery<TSource> source,
Func<TResult> seedFactory,
Func<TResult, TSource, TResult> aggregator) {
return source.Aggregate(seedFactory, aggregator, aggregator, x => x);
}
but I get a compilation error:
Error 1 The type arguments for method 'System.Linq.ParallelEnumerable.Aggregate(
System.Linq.ParallelQuery<TSource>
,TAccumulate
,System.Func<TAccumulate,TSource,TAccumulate>
,System.Func<TAccumulate,TAccumulate,TAccumulate>
,System.Func<TAccumulate,TResult>
)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
The overload I want to use is this one while the compiler seems to think it can be this one too.
How can I help it?