Merge pull request #1861 from saper/home-override
[mono-project.git] / mcs / tests / test-158.cs
blobcdb8d45d54b1bc6d32f328cdf93b3c1e4c84db2e
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 public static 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;