[Issue 7021] Structs with disabled default constructors can be constructed without calling a constructor.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 24 08:31:52 PDT 2012


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



--- Comment #16 from Jonathan M Davis <jmdavisProg at gmx.com> 2012-09-24 08:32:45 PDT ---
> That's a bug: .init for nested structs is garbage. It's the cause of bug 6419,
for example. defaultInitLiteral() is wrong.

Then I _definitely_ think that S() and S.init should always be the same for
structs as long as static opCall has not been declared, and

@disable this();

should disable S.init such that it's impossible to ever default-initialize S or
to use S.init or to use S() (though S() should still work if static opCall is
declared).

-- 
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