Upozornění kompilátoru (úroveň 3) CS0168

Proměnná var je deklarována, ale nikdy se nepoužívá.

Kompilátor vydá upozornění úrovně tři při deklaraci proměnné, ale nepoužívá ji.

Následující ukázka vygeneruje upozornění CS0168:

// CS0168.cs  
// compile with: /W:3  
public class clx
{
    public int i;
}

public class clz
{
    public static void Main() {
        clx a; // CS0168, the variable 'a' is declared but never used
        // try the following line instead
        // clx a = new clx();  // this does not generate a warning because the clx constructor must execute.
    }
}