[Issue 9372] Class member with @disabled ctor makes class ctor unusable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 23 08:02:59 PST 2013


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



--- Comment #4 from Jacob Carlborg <doob at me.com> 2013-01-23 08:02:58 PST ---
(In reply to comment #3)
> P.S. Even Object.factory does not allow the creation of objects without a
> default ctor, so I'd argue that in no case should the implementation require
> that all class fields be default-initializable when there's already a ctor to
> do the job.

Then that will break a lot of the safety D provides with its default
initialized variables. Example:

class Foo
{
    int a; // assume this is not initialized

    this ()
    {
        writeln(a); // writes garbage
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list