[Mono-bugs] [Bug 582360] New: Ambiguity w/ method resolution containing default parameters.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Feb 23 14:26:15 EST 2010


http://bugzilla.novell.com/show_bug.cgi?id=582360

http://bugzilla.novell.com/show_bug.cgi?id=582360#c0


           Summary: Ambiguity w/ method resolution containing default
                    parameters.
    Classification: Mono
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: openSUSE 11.2
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---


Consider the following code:

  class Test {
    public static void Main ()
    {
      Foo ("bar!");
    }

    static void Foo (string s) {}
    static void Foo (string s, string o = null) {}
  }

Compiling results in:

  ambd.cs(4,7): error CS0121: The call is ambiguous between the following 
  methods or properties: `Test.Foo(string)' and `Test.Foo(string, string)'

As per IRC discussions, this should be valid code, and Foo(string) should be
preferred over Foo(string,string).

-- 
Configure bugmail: http://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