Sdílet prostřednictvím


Compilerfehler CS0722

Aktualisiert: November 2007

Fehlermeldung

"Typ": Statische Typen können nicht als Rückgabetypen verwendet werden.
'type': static types cannot be used as return types

Ein statischer Typ als Rückgabetyp ist nicht sinnvoll, da Instanzen von statischen Typen nicht erstellt werden können.

Im folgenden Beispiel wird CS0722 generiert:

// CS0722.cs
public static class SC
{
}


public class CMain
{
   public SC F()  // CS0722
   {
      return null;
   }

   public static void Main()
   {
   }
}