[Mono-bugs] [Bug 75514][Wis] New - Attribute.IsDefined does not detect ParamArrayAttribute in ParameterInfo

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jul 9 10:23:11 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by rodrigobamboo at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=75514

--- shadow/75514	2005-07-09 10:23:11.000000000 -0400
+++ shadow/75514.tmp.31711	2005-07-09 10:23:11.000000000 -0400
@@ -0,0 +1,47 @@
+Bug#: 75514
+Product: Mono: Class Libraries
+Version: 1.0
+OS: 
+OS Details: ubuntu, mono revision 47133 --with-preview=no
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: rodrigobamboo at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Attribute.IsDefined does not detect ParamArrayAttribute in ParameterInfo
+
+using System;
+using System.Reflection;
+using System.Diagnostics;
+
+public class IsDefinedDoesNotWork
+{
+    public static void ParamsMethod(params object[] args)
+    {
+    }
+
+    static void Main(string[] args)
+    {
+        ParameterInfo parameter =
+typeof(IsDefinedDoesNotWork).GetMethod("ParamsMethod").GetParameters()[0];
+        Attribute[] attributes = Attribute.GetCustomAttributes(parameter);
+        assert(1 == attributes.Length);
+        assert(attributes[0] is ParamArrayAttribute);
+
+        assert(Attribute.IsDefined(parameter, typeof(ParamArrayAttribute)));
+    }
+
+    static void assert(bool condition)
+    {
+        if (!condition)
+        {
+            throw new ApplicationException();
+        }
+    }
+}


More information about the mono-bugs mailing list