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>2004-09-22 16:48:01 +0400
committerMartin Baulig <martin@novell.com>2004-09-22 16:48:01 +0400
commitf9e173275c7e2717ce7575e398f051b7b02b6697 (patch)
treee63ac2a32b2a2dfde451de8dccacfef2a3d2ebc3 /mcs/tests/test-297.cs
parent562af229ed552db254159842cdb55f35d7eab919 (diff)
2004-09-22 Martin Baulig <martin@ximian.com>
* test-297.cs: New test for #28562. svn path=/trunk/mcs/; revision=34215
Diffstat (limited to 'mcs/tests/test-297.cs')
-rw-r--r--mcs/tests/test-297.cs39
1 files changed, 39 insertions, 0 deletions
diff --git a/mcs/tests/test-297.cs b/mcs/tests/test-297.cs
new file mode 100644
index 00000000000..993a6ba521a
--- /dev/null
+++ b/mcs/tests/test-297.cs
@@ -0,0 +1,39 @@
+using System;
+
+[My((long)1)]
+[My(TypeCode.Empty)]
+[My(typeof(System.Enum))]
+class T {
+ static int Main() {
+ object[] a = Attribute.GetCustomAttributes (typeof (T), false);
+ if (a.Length != 3)
+ return 1;
+ foreach (object o in a) {
+ My attr = (My)o;
+ if (attr.obj.GetType () == typeof (long)) {
+ long val = (long) attr.obj;
+ if (val != 1)
+ return 2;
+ } else if (attr.obj.GetType () == typeof (TypeCode)) {
+ TypeCode val = (TypeCode) attr.obj;
+ if (val != TypeCode.Empty)
+ return 3;
+ } else if (attr.obj.GetType ().IsSubclassOf (typeof (Type))) {
+ Type val = (Type) attr.obj;
+ if (val != typeof (System.Enum))
+ return 4;
+ } else
+ return 5;
+
+ }
+ return 0;
+ }
+}
+
+[AttributeUsage(AttributeTargets.All,AllowMultiple=true)]
+class My : Attribute {
+ public object obj;
+ public My (object o) {
+ obj = o;
+ }
+}