Hmm, it worked for me, but that was almost a year ago. Maybe I wrapped a Variant around?
vars ~= Variant("Jan");
(*testing*)
Yes, it works:
Variant[] vars; int[char[]][int] indices;
vars ~= Variant("Jan"); indices[0]["Month"] = vars.length-1;
Ugly as sin, though, and cumbersome to use. But I used it to add 'properties' to nodes and edges in a graph class (like, adding weight to edges as double, and names to nodes as strings...) and it worked quite well, with a few functions to hide the trick away.
But it's sad you can't use Variant directly as a value. You can use it as a key, sort of:
int[Variant] test; test[Variant(3)] = 4; // test[3] = 4 does not work test[Variant("abc")] = 0;
writeln(test[Variant("abc")]); // 0 auto k = test.keys; // crash! Assertion failure: 'impl' on line 3886 in file 'mtype.c'