Compilerfehler CS1593

Der Delegat "del" akzeptiert "number"-Argumente nicht

Die Anzahl der an einen Delegat aufruf übergebenen Argumente stimmt nicht mit der Anzahl der Parameter in der Delegatdeklaration überein.

Im folgenden Beispiel wird CS1593 generiert:

// 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);  
   }  
}