www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11672] New: default initialization of static array of structs with a single value fails

https://d.puremagic.com/issues/show_bug.cgi?id=11672

           Summary: default initialization of static array of structs with
                    a single value fails
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: nilsbossung googlemail.com



---
---
cat > test.d << code
struct V {float f;}
struct S
{
    V[3] v = V(1);
}
void main()
{
    S s;
    assert(s.v == [V(1), V(1), V(1)]); /* fails, is [V(42), V(nan), V(nan)] */
}
code
rdmd test.d
---
core.exception.AssertError test(9): Assertion failure
---

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