[Mono-bugs] [Bug 478333] New: Wrong ctor method used

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Feb 20 15:34:23 EST 2009


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


           Summary: Wrong ctor method used
    Classification: Mono
           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: fejj at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Just ran into a bug in gmcs where the wrong ctor method is used in the
following scenario:


using System;

public class Test
{    
    static void Main()
    {
        Foo fu = new Foo (null);
    }
}

class Foo {
    public Foo (object o)
    {
        Console.WriteLine ("Called the right ctor!");
    }

    public Foo (string s, params object [] args)
    {
        Console.WriteLine ("Called the wrong ctor!");
    }
}

new Foo (null) /should/ use the Foo(object) ctor, but it is using the
Foo(string, params object[]) ctor instead.

If I do fu = new Foo ((object) null), it calls the correct ctor.

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