Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <martin@novell.com>2002-08-07 02:12:19 +0400
committerMartin Baulig <martin@novell.com>2002-08-07 02:12:19 +0400
commit9a4aae931ceed1454575a9fd7bd0b9a964abe15d (patch)
tree87623ba5ba8ad19ecea273a2516e56c9a5b71c38 /mcs/tests/test-158.cs
parent0c3d101ecdee2e3fc2e0fe3549d6f3a7ae947990 (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.cs28
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;
+ }
+ }
+}