Compiler Error J0258

Cannot declare delegate in inner class 'identifier'

The compiler detected an attempt to declare a delegate inside an inner class. Inner class definitions do not support delegates declared within them. Remove the delegate declaration from within the inner class declaration and compile again.

The following example illustrates this error:

public class Simple{
   //Do something meaningful here
   class InnerClass{
   //Do something meaninful here
      delegate int MyDelegate (int var1, String var2);
         /*error: delegates cannot be declared
                  inside inner classes */
   }
}