digitalmars.D.bugs - [Issue 7121] New: Structs with Disabled Default Constructors Also Disable No-Arg Constructors in Classes
- d-bugmail puremagic.com (43/43) Dec 16 2011 http://d.puremagic.com/issues/show_bug.cgi?id=7121
- d-bugmail puremagic.com (10/10) Jul 27 2012 http://d.puremagic.com/issues/show_bug.cgi?id=7121
http://d.puremagic.com/issues/show_bug.cgi?id=7121 Summary: Structs with Disabled Default Constructors Also Disable No-Arg Constructors in Classes Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: debio264 gmail.com --- Comment #0 from Andrew Wiley <debio264 gmail.com> 2011-12-16 13:02:15 PST --- Code sample: ``` struct SomeStruct { disable this(); this(int arg) { } } class SomeClass { private: SomeStruct _stuff; public: this() { _stuff = SomeStruct(10); } } void someFunc() { SomeClass obj = new SomeClass(); // Error: default construction is disabled for type SomeClass } ``` As you can see, the disabled constructor in SomeStruct breaks the no-arg constructor in SomeClass. Disabling the *default* constructor in SomeClass is correct, but if a no-arg constructor is implemented, it should be checked against the same rules as other constructors (and an error should occur if it doesn't initialize the disabled struct). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 16 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7121 Simen Kjaeraas <simen.kjaras gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |wfunction hotmail.com --- Comment #1 from Simen Kjaeraas <simen.kjaras gmail.com> 2012-07-27 15:38:31 PDT --- *** Issue 8117 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 27 2012