Syntax highlighting bug: Attribute targeting Enum value
I take it this needs to be declared something like this:
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class MyCustomAttribute : Attribute
{
//Some properties...
}
public enum MyEnum : int
{
[MyCustom]
One = 1,
[MyCustom]
Two = 2,
[MyCustom]
Three = 3,
}
However, syntax highlighting is claiming the following:
With red underlining, "Attribute is not valid on this declaration type. It is valid on 'Enum' declarations only.
However, to the compiler, this builds interestingly enough.
I am targeting a .NET 4.5 that I know of, x64 bit.
Is this some obscure C# thing? Or a Resharper bug?
Thank you...
Please sign in to leave a comment.