[Issue 11211] Use of uninitialized struct allowed in a subclass

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 24 09:07:11 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=11211

Max Samukha <maxsamukha at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxsamukha at gmail.com

--- Comment #3 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to mhh from comment #1)
> The struct is in a valid state

How is that? The default constructor is explicitly disabled to tell the
compiler that the init state is *not valid* for that struct type (it is even
dubbed "best practice" by p.6 of
https://dlang.org/spec/struct.html#field-init).

--


More information about the Digitalmars-d-bugs mailing list