@disabled Propagating to Classes?

Andrew Wiley wiley.andrew.j at gmail.com
Fri Dec 16 13:02:46 PST 2011


On Fri, Dec 16, 2011 at 2:28 PM, Timon Gehr <timon.gehr at gmx.ch> wrote:
> 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.

Filed: http://d.puremagic.com/issues/show_bug.cgi?id=7121


More information about the Digitalmars-d mailing list