What    |Removed                     |Added
                 CC|                            |
           Severity|normal                      |major

--- Comment #1 from 2012-02-03 22:40:54 PST ---
It gets worse. The following doesn't compile either:

// (package scope)
auto hash = [ "abc":1, "def":2, "ghi":3 ];

Neither does this compile:

int[string] hash = [ "abc":1, "def":2, "ghi":3 ];

This happens on both dmd 2.057 (Linux) and gdc 4.6.2 (Linux).

It seems that initializing associative arrays with literals only works in
function scope. IMHO this is a major bug. It completely breaks CTFE for
associative arrays (trying to assign to an assoc array in a CTFE function
triggers the same error), and greatly limits the usefulness of having a literal
in the first place.

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

Reply via email to