Compartilhar via


CS1909 de erro do compilador

Mensagem de erro

O atributo DefaultValue não é aplicável em parâmetros de tipo 'tipo'

CS1909 é gerada quando você usa um DefaultValue atributo que não é aplicável no tipo de parâmetro.

Exemplo

O exemplo a seguir gera CS1909.

// CS1909.cs
// compile with: /target:library
using System.Runtime.InteropServices;

public interface ISomeInterface
{
   void Test1([DefaultParameterValue(new int[] {1, 2})] int[] arr1);   // CS1909

   void Test2([DefaultParameterValue("Test String")] string s);   // OK
}