CS0305, Invalid number of arguments when using System.Func delegate
I get following error:
error CS0305: Using the generic type
'System.Func<T1,T2,T3,T4,T5,T6,T7,T8,T9,TResult>'
requires '10' type arguments
On this line:
public static IDoubleArray ApplyFunc(IDoubleArray inputArray1,
IDoubleArray inputArray2,
Func<double, double, double> f) {
The Func definition in the System namespace looks like this:
[TypeForwardedFrom("System.Core, Version=3.5.0.0,
Culture=Neutral,
PublicKeyToken=b77a5c561934e089")]
public delegate TResult
Func<in T1, in T2, out TResult>(T1 arg1, T开发者_如何学Go2 arg2);
Everything looks fine, but compiler doesn't think so.
Any ideas how to solve this?
Thanks.
edit:
The call looks like this:
/// <summary>Inverse cumulative distribution function</summary>
/// <param name="p">Probabilities at which to compute the inverse cdf</param>
/// <param name="mu">Scale parameters</param>
public static IDoubleArray Inv(IDoubleArray p, IDoubleArray mu)
{
return ArrayMath.ApplyFunc(Matrix.ConvertToMatrix(p), Matrix.ConvertToMatrix(mu), Inv);
}
Solved. The problem was the target wasn't .NET 4.0.
精彩评论