www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15515] New: default construction disabled for struct

https://issues.dlang.org/show_bug.cgi?id=15515

          Issue ID: 15515
           Summary: default construction disabled for struct constructor
                    with default arguments
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << EOF
struct S {
    this(string r = ".") {
    }
}

void test() {
    S s;
}
EOF

dmd -c bug

----
bug.d(7): Error: variable bug.test.s default construction is disabled for type
S
----

This was turned into an error between 2.069.2 and 2.070.0 without any
deprecation step.

--
Jan 04