Compiler Error CS1593
Delegate 'del' does not take 'number' arguments
The number of arguments passed to a delegate invocation does not agree with the number of parameters in the delegate declaration.
The following sample generates CS1593:
// CS1593.cs
using System;
delegate string func(int i); // declare delegate
class a
{
public static void Main()
{
func dt = new func(z);
x(dt);
}
public static string z(int j)
{
Console.WriteLine(j);
return j.ToString();
}
public static void x(func hello)
{
hello(8, 9); // CS1593
// try the following line instead
// hello(8);
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for