http://d.puremagic.com/issues/show_bug.cgi?id=3476
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
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrei Alexandrescu <[email protected]> 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------