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


hst...@quickfur.ath.cx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hst...@quickfur.ath.cx
           Severity|normal                      |major


--- Comment #1 from hst...@quickfur.ath.cx 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to