I receiving the following error: "Using generic type 'Func<TResult>' requires 1 type arguments". It occurs when I attempt to define a dictionary which maps strings to delegate functions.
The dictionary looks like this:
Dictionary<string, string> builtInFunctions = new Dictionary<string, Func<Expression, Dictionary<string, string>, Dictionary<string, Value>, Dictionary<string, Token>, Dictionary<string, Cube>, Result>>()
{
{"ToString", ToString}
};
Result ToString(
Expression expression,
Dictionary<string, string> env,
Dictionary<string, Value> store,
ref Dictionary<string, Token> tokenEnv,
ref Dictionary<string, Cube> cubeEnv
) {
// implemented ToString function
}
And the error is occurring on this partof the code:
Func<Expression, Dictionary<string, string>, Dictionary<string, Value>, Dictionary<string, Token>, Dictionary<string, Cube>, Result>
And it still appears if I use different simpler types for it, for instance:
Func<int, int, int, int, int, int>
Can delegate functions only take 4 arguments, or is there a way around this?