https://bugzilla.novell.com/show_bug.cgi?id=662867

https://bugzilla.novell.com/show_bug.cgi?id=662867#c0


           Summary: Attribute.GetCustomAttributes fails in searching
                    inheritance chain against overridden method ToString()
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: Macintosh
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs@lists.ximian.com
        ReportedBy: rko...@gmail.com
         QAContact: mono-bugs@lists.ximian.com
          Found By: ---
           Blocker: ---


Description of Problem:

ttribute.GetCustomAttributes fails in searching inheritance chain against
overridden method ToString()


Steps to reproduce the problem:
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)]
    public class CAttr : Attribute
    {
        public CAttr ()
        {
        }
    }

    class One
    {
        [CAttr]
        public override string ToString ()
        {
            return null;
        }
    }

    class Two : One
    {
    }
    class Three : Two
    {
    }
    class Four : Three
    {
    }
    class Five : Four
    {
        public override string ToString ()
        {
             return null;
        }
    }

    class Driver
    {
        static void Main (string[] args)
        {
            var attrs = Attribute.GetCustomAttributes (typeof(Five).GetMethod
("ToString"), true);
            Console.WriteLine (attrs[0]);
        }
    }


Actual Results:
attrs is null

Expected Results:
attrs should have one attribute in array 

How often does this happen? 
always

Additional Information:

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist  -  mono-bugs@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to