http://d.puremagic.com/issues/show_bug.cgi?id=5223

           Summary: [qtd] Cannot use default value with function parameter
                    of struct type
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: samu...@voliacable.com


--- Comment #0 from Max Samukha <samu...@voliacable.com> 2010-11-16 09:36:29 
PST ---
Struct constructors are disregarded when a struct parameter is constructed out
of a default value:

struct S2
{
}

struct S
{
    int x;

    this(S2 s2)
    {
    }

    void foo(S s = S(S2))
    {
    }
}

void main()
{
    S s;
    s.foo(); // error
}

Error: cannot implicitly convert expression (S2()) of type S2 to int.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to