[Mono-bugs] [Bug 447027] New: gmcs fails to resolve method call with generic delegate

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Nov 20 05:51:52 EST 2008


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


           Summary: gmcs fails to resolve method call with generic delegate
           Product: Mono: Compilers
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: rkvinge at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Repro:

class T
{
        void Test ()
        {
                Attach (OnClick);
        }

        void Attach (EventHandler handler)
        {
        }
        void Attach (EventHandler<string> handler)
        {
        }

        void OnClick (string sender)
        { }
}

delegate void EventHandler (object sender);
delegate void EventHandler<T> (T sender);

Result:
rolf at linux:> gmcs test.cs -target:library
test.cs(5,17): error CS0121: The call is ambiguous between the following
methods or properties: `T.Attach(EventHandler)' and
`T.Attach(EventHandler<string>)'
test.cs(8,14): (Location of the symbol related to previous error)
test.cs(11,14): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

csc v3.5.30729.1 compiles this code successfully.


-- 
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.


More information about the mono-bugs mailing list