diff options
author | Martin Baulig <martin@novell.com> | 2002-08-07 02:12:19 +0400 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2002-08-07 02:12:19 +0400 |
commit | 9a4aae931ceed1454575a9fd7bd0b9a964abe15d (patch) | |
tree | 87623ba5ba8ad19ecea273a2516e56c9a5b71c38 /mcs/tests/test-158.cs | |
parent | 0c3d101ecdee2e3fc2e0fe3549d6f3a7ae947990 (diff) |
2002-08-07 Martin Baulig <martin@gnome.org>
* test-158.cs: New test for bug #22119.
svn path=/trunk/mcs/; revision=6485
Diffstat (limited to 'mcs/tests/test-158.cs')
-rw-r--r-- | mcs/tests/test-158.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mcs/tests/test-158.cs b/mcs/tests/test-158.cs new file mode 100644 index 00000000000..1de8e5db77e --- /dev/null +++ b/mcs/tests/test-158.cs @@ -0,0 +1,28 @@ +using System; +using System.Reflection; + +[AttributeUsage (AttributeTargets.All)] +public class My : Attribute { + public object o; + + public My (object o) { + this.o = o; + } + + [My(TypeCode.Empty)] + 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 != 1) + return 1; + My attr = (My) attributes [0]; + if (attr.o != TypeCode.Empty) + return 2; + return 0; + } + } +} |