Comment #0 by verylonglogin.reg — 2014-03-16T06:58:43Z
This code used to work:
---
struct S
{
size_t opDollar() { return 0; }
size_t opIndex(size_t) { return 0; }
}
enum e = S.init[$]; // line 7
---
main.d(7): Error: static variable __dollar cannot be read at compile time
main.d(7): called from here: S().opIndex(__dollar)
---
This is a rather old regression.
Comment #1 by dlang-bugzilla — 2014-03-17T00:54:38Z
When did it work? opDollar was implemented in 2.057 and the code doesn't compile in any version since then.
Comment #2 by verylonglogin.reg — 2014-03-17T06:18:59Z