[Issue 508] New: All members of an array need not be initialised

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 15 03:06:38 PST 2006


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

           Summary: All members of an array need not be initialised
           Product: D
           Version: 0.174
          Platform: PC
               URL: http://www.digitalmars.com/d/arrays.html
        OS/Version: Windows
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com


The spec states "If any members of an array are initialized, they all must be."
along with explanation of why this choice was made.

Yet, the following code, _from the same section of the spec_, compiles and
runs:

int[3] a = [ 1:2, 3 ]; // a[0] = 0, a[1] = 2, a[2] = 3

Which is correct? Remove the paragraph from the spec or change compiler
behaviour to match, changing the comment in the above to "// fails, a[0] not
initialised" or equivalent.

This is the first of a number of documentation-related bugs I'll be filing: I'm
going to mark them as priority "P4" (defer until next major version) since they
need fixing prior to D 1.0.


-- 




More information about the Digitalmars-d-bugs mailing list