Errore del compilatore CS0522

Aggiornamento: novembre 2007

Messaggio di errore

'costruttore': le strutture non possono chiamare costruttori della classe base.
'constructor' : structs cannot call base class constructors

Una struttura non può chiamare un costruttore di una classe base. Rimuovere la chiamata.

Il seguente codice di esempio genera l'errore CS0522:

// CS0522.cs
public class clx
{
   public clx(int i)
   {
   }

   public static void Main()
   {
   }
}

public struct cly
{
   public cly(int i):base(0)   // CS0522
   // try the following line instead
   // public cly(int i)
   {
   }
}