this one has been passing for quite a while now
[mcs.git] / tests / test-158.cs
blob80b26d88ed0daf86a1d699d39010e6e814c7e2c4
1 using System;
2 using System.Reflection;
4 [AttributeUsage (AttributeTargets.All)]
5 public class My : Attribute {
6 public object o;
8 public My (object o) {
9 this.o = o;
12 [My(TypeCode.Empty)]
13 public class Test {
14 static public int Main() {
15 System.Reflection.MemberInfo info = typeof (Test);
16 object[] attributes = info.GetCustomAttributes (false);
17 for (int i = 0; i < attributes.Length; i ++) {
18 System.Console.WriteLine(attributes[i]);
20 if (attributes.Length != 1)
21 return 1;
22 My attr = (My) attributes [0];
23 if ((TypeCode) attr.o != TypeCode.Empty)
24 return 2;
25 return 0;