[Mono-bugs] [Bug 37380][Nor] New - MonoCustomAtts.IsDefined fails

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 29 Jan 2003 12:41:36 -0500 (EST)


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 gonzalo@ximian.com.

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

--- shadow/37380	Wed Jan 29 12:41:36 2003
+++ shadow/37380.tmp.6756	Wed Jan 29 12:41:36 2003
@@ -0,0 +1,55 @@
+Bug#: 37380
+Product: Mono/Class Libraries
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: MonoCustomAtts.IsDefined fails
+
+Test case by Zoltan Varga:
+
+using System;
+using System.Reflection;
+
+[AttributeUsage(AttributeTargets.Method, AllowMultiple=false)]
+        public sealed class SetUpAttribute : Attribute {
+}
+
+class Foo {
+
+        [SetUpAttribute]
+        protected virtual void foo () {
+        }
+}
+
+class Bar : Foo {
+        protected override void foo () {
+        }
+}
+
+class Bug {
+        static public void Main() {
+                foreach (MethodInfo method in
+typeof(Bar).GetMethods(BindingFlags.Public|BindingFlags.Instance|BindingFlags.NonPublic))
+{
+                        if(method.IsDefined(typeof (SetUpAttribute),true)) {
+                                Console.WriteLine (method);
+                        }
+                }
+        }
+}
+
+This should say:
+void foo ()
+
+but on mono it does not output anything.