CS0308 de erro do compilador

Mensagem de erro

O método não genérico tipo-ou-'identificador' não pode ser usado com argumentos de tipo.

O tipo ou método não é genérico mas foi usado com argumentos de tipo.Para evitar esse erro, remova sistema autônomo colchetes angulares e argumentos de tipo ou redeclare o tipo ou método sistema autônomo um método genérico ou tipo.

O exemplo a seguir gera CS0308:

// CS0308a.cs
class MyClass
{
   public void F() {}
   public static void Main()
   {
      F<int>();  // CS0308 – F is not generic.
      // Try this instead:
      // F();
   }
}

O exemplo a seguir também gera CS0308.Para resolver o erro, use a diretiva "using sistema.Collections.Generic".

// CS0308b.cs
// compile with: /t:library
using System.Collections;
// To resolve, uncomment the following line:
// using System.Collections.Generic;
public class MyStack<T>
{
    // Store the elements of the stack:
    private T[] items = new T[100];
    private int stack_counter = 0;

    // Define the iterator block:
    public IEnumerator<T> GetEnumerator()   // CS0308
    {
        for (int i = stack_counter - 1 ; i >= 0; i--)
        yield return items[i];
    }
}