class MyAttribute : Attribute
{
// error CS0120: An object reference is required for the nonstatic field, method, or property 'object.GetType()'
// error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression
[My(newint[] { GetType().GetHashCode() })]
public MyAttribute(int[] x) { }
}
Description
class MyAttribute : Attribute
{
// error CS0120: An object reference is required for the nonstatic field, method, or property 'object.GetType()'
// error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression
[My(newint[] { GetType().GetHashCode() })]
public MyAttribute(int[] x) { }
}