linux-packaging-mono/mcs/tests/test-anon-141.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

28 lines
708 B
C#

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