digitalmars.D - disabled Propagating to Classes?
- Andrew Wiley (22/22) Dec 16 2011 Is this a bug?
- Timon Gehr (3/25) Dec 16 2011 Definitely a bug. This has been brought up before, but I think that
- Andrew Wiley (4/35) Dec 16 2011 is
Is this a bug? ``` 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 } ``` It doesn't seem like disabled default constructors should propagate this way.
Dec 16 2011
On 12/16/2011 09:20 PM, Andrew Wiley wrote:Is this a bug? ``` 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 } ``` It doesn't seem like disabled default constructors should propagate this way.Definitely a bug. This has been brought up before, but I think that there is no bug report yet.
Dec 16 2011
On Fri, Dec 16, 2011 at 2:28 PM, Timon Gehr <timon.gehr gmx.ch> wrote:On 12/16/2011 09:20 PM, Andrew Wiley wrote:truction isIs this a bug? ``` struct SomeStruct { =A0 =A0 =A0 =A0 disable this(); =A0 =A0 =A0 =A0this(int arg) { =A0 =A0 =A0 =A0} } class SomeClass { =A0 =A0 =A0 =A0private: =A0 =A0 =A0 =A0SomeStruct _stuff; =A0 =A0 =A0 =A0public: =A0 =A0 =A0 =A0this() { =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0_stuff =3D SomeStruct(10); =A0 =A0 =A0 =A0} } void someFunc() { =A0 =A0 =A0 =A0SomeClass obj =3D new SomeClass(); // Error: default cons=isdisabled for type SomeClass } ``` It doesn't seem like disabled default constructors should propagate this way.Definitely a bug. This has been brought up before, but I think that there=no bug report yet.Filed: http://d.puremagic.com/issues/show_bug.cgi?id=3D7121
Dec 16 2011