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

           Summary: Non-uniform handling of commas in static
                    initialization of structs
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: stanislav.bli...@gmail.com


--- Comment #0 from Stanislav Blinov <stanislav.bli...@gmail.com> 2010-08-28 
11:29:37 PDT ---
Compiler behaves differently for different cases when handling field
initializers for structs:

struct S1
{
    int a, b, c;

    static immutable S1 C1 = { 1 2 3 }; // no commas here, compiles
    static immutable S1 C2 = { 1, 2, 3 }; // compiles as well
}

int foo() { return 3; }

struct S2
{
    int a, b, c;

    static immutable S2 C1 = { foo() 2 3 }; // compiles (and works)
    static immutable S2 C2 = { foo() 2, 3 }; // compiles (and works)
    static immutable S2 C3 = { 2 foo() 3 }; // does not compile: comma expected
separating field initializers
}

Encountered this on 2.048 Windows (AMD64), 2.047 and 2.048 Linux (AMD64)

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

Reply via email to