Comment #0 by bearophile_hugs — 2010-04-05T05:41:16Z
bool foo(string s) {
enum int[string] aa = ["aa":1, "bb":2];
return cast(bool)(s in aa);
}
enum bool r = foo("xx");
void main() {}
dmd 2.042 gives:
test.d(3): Error: Cannot interpret s in (["aa":1,"bb":2]) at compile time
test.d(5): Error: cannot evaluate foo("xx") at compile time
test.d(5): Error: cannot evaluate foo("xx") at compile time
I have tagged this as major bug because it limits a lot the uses of AAs in CTFE. And AA.get too is not available yet at compile-time.
I presume this is caused by the pointers that are not available yet at compile-time.