eol
[mcs.git] / tests / gtest-anon-41.cs
blob65ff085f1f2128c580fdc8a237ff9400aeff7698
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
5 // Tests caching of closed generic anonymous delegates
7 static class C
9 public static decimal Average<TSource> (this IEnumerable<TSource> source, Func<TSource, decimal> selector)
11 return source.Select (selector).Average<decimal, decimal, decimal> ((a, b) => a + b, (a, b) => a / b);
14 static TResult Average<TElement, TAggregate, TResult> (this IEnumerable<TElement> source,
15 Func<TAggregate, TElement, TAggregate> func, Func<TAggregate, TElement, TResult> result)
16 where TElement : struct
17 where TAggregate : struct
18 where TResult : struct
20 throw new InvalidOperationException ();
23 public static void Main ()