Cannot initialize associative array.

dcoder dcoder at devenull.dev
Tue Jun 22 14:32:48 PDT 2010


Sorry, I forgot to put some compiler output:

For the declaration: uint[string] mywords = [ "Hello" : 1, "World" : 1, "Cat" : 1,
"Dog" : 1 ];


I get:

$ dmd test_01.d
test_01.d(3): Error: non-constant expression ["Hello":1u,"World":1u,"Cat":1u,"Dog":1u]



More information about the Digitalmars-d-learn mailing list