Summary: Static array .init is actually .init of the array
                    element type, not the array.
           Product: D
           Version: D1 & D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from David Eckardt <> 2012-03-22 
08:34:02 PDT ---
Let T be a type and n a size_t constant, then T[n].init is the same as T.init.

This causes the program code

        int[5] x;

        if (x == x.init) { /* ... */ }

to be rejected with the compiler error message "Error: incompatible types for
((x) == (0)): 'int[5u]' and 'int'", whereas

    static assert(x.init == x[0].init);

passes successfully.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to