diff options
Diffstat (limited to 'mcs/errors/cs-20.cs')
-rw-r--r-- | mcs/errors/cs-20.cs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/mcs/errors/cs-20.cs b/mcs/errors/cs-20.cs deleted file mode 100644 index 6f33e0dcfd3..00000000000 --- a/mcs/errors/cs-20.cs +++ /dev/null @@ -1,35 +0,0 @@ -// cs-20.cs : Cannot find attribute type My (maybe you forgot to set the usage using the AttributeUsage attribute ?). -// Line : 18 - -using System; -using System.Reflection; - -namespace Test { - - //[AttributeUsage (AttributeTargets.All)] - public class MyAttribute: Attribute { - public string val; - public MyAttribute (string stuff) { - System.Console.WriteLine (stuff); - val = stuff; - } - } - - [My("testclass")] - - public class Test { - static public int Main() { - System.Reflection.MemberInfo info = typeof (Test); - object[] attributes = info.GetCustomAttributes (false); - for (int i = 0; i < attributes.Length; i ++) { - System.Console.WriteLine(attributes[i]); - } - if (attributes.Length != 2) - return 1; - MyAttribute attr = (MyAttribute) attributes [0]; - if (attr.val != "testclass") - return 2; - return 0; - } - } -} |