Summary: C-style initializer for structs must be disallowed for
                    structs with a constructor
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrei Alexandrescu <> 2009-11-05 
13:55:02 PST ---
struct S {
    int a;
    this(int) {}

S s = { 1 };

This code should not compile. The presence of the constructor means S's author
wants to guard some invariant. The C-style constructor may initialize the
object to an arbitrary value.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to