Dela via


Kompilatorvarning (nivå 4) CS0649

Fältet "fält" tilldelas aldrig till och har alltid standardvärdet "värde"

Kompilatorn identifierade en icke-initierad privat eller intern fältdeklaration som aldrig tilldelas ett värde.

Följande exempel genererar CS0649:

// CS0649.cs  
// compile with: /W:4  
using System.Collections;  
  
class MyClass  
{  
   Hashtable table;  // CS0649  
   // You may have intended to initialize the variable to null  
   // Hashtable table = null;  
  
   // Or you may have meant to create an object here  
   // Hashtable table = new Hashtable();  
  
   public void Func(object o, string p)  
   {  
      // Or here  
      // table = new Hashtable();  
      table[p] = o;  
   }  
  
   public static void Main()  
   {  
   }  
}