The version of Aggregate<TSource>
you are referring to is Aggregate<TSource>(this IEnumerable<TSource> enumerable)
.
This particular overload of aggregate is the only one which does not contain a seed (read starting value) for the aggregate operation. This creates an interesting case when the enumeration contains no elements. The method could do one of the following
- Throw an exception alerting the user to the issue
- Return
default(TSource)
The author of the library chose to do the first one. Why I don't specifically know but likely because it was viewed as an ambiguity and it's best to make ambiguities loud vs. succeed (possible incorrectly) silently
The other two overloads have no issue because they have a seed / initial value which can be returned.