using System; using System.Collections.Generic; using System.Linq; // Tests caching of closed generic anonymous delegates static class C { public static decimal Average (this IEnumerable source, Func selector) { return source.Select (selector).Average ((a, b) => a + b, (a, b) => a / b); } static TResult Average (this IEnumerable source, Func func, Func result) where TElement : struct where TAggregate : struct where TResult : struct { throw new InvalidOperationException (); } public static void Main () { } }