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


Steven Schveighoffer <schvei...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |schvei...@yahoo.com


--- Comment #1 from Steven Schveighoffer <schvei...@yahoo.com> 2011-01-07 
06:46:51 PST ---
This is really a documentation issue.  The init() is correct, as I discovered
when fixing a recent bug.

Essentially, when the ptr is null, but the length is non-zero, the meaning is
that the init value for that type is init().length bytes of zero.  This cuts
down on having to store an array of zeros in the binary.

The documentation for init() says:

"Return default initializer, null if default initialize to 0"

Which seems to indicate init() should return null if default initializer should
be zero.  But a null array has length == 0.

I think the right solution to this is to change the documentation:

"Return default initializer.  If the type should be initialized to all zeros,
an array with a null ptr and a length equal to the type size will be returned"

Sound good?

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

Reply via email to