Comment #0 by bearophile_hugs — 2011-09-12T15:47:11Z
D2 code:
enum size_t N = 1;
int[bar.length] foo;
int[N] bar;
void main() {}
DMD 2.055 gives:
Error: cannot create associative array int[N]
This is a very nice bug. There are three problems here: refusing valid code, thinking bar is an associative array instead of a fixed-sized one, and giving no line number.
Comment #1 by yebblies — 2011-09-14T06:01:52Z
The problem here is that TypeAArray::getImpl is being called on bar before semantic has, therefore there is no scope or location. Of the three problems, the lack of scope causes the failure to lookup N (and therefore the failure to recognize bar as a static array), and also the lack of a file/line number.
Comment #2 by github-bugzilla — 2012-04-24T00:48:32Z