auto foo()
{
struct S
{
int i;
void bar() { }
}
pragma(msg, S.init.tupleof[$-1]);
}
void main()
{
}
dmd 2.061 (actually fresh from git head);
dmd: expression.c:4249: Expression* StructLiteralExp::getField(Type*, unsigned int): Assertion `i < elements->dim' failed.
Aborted
Comment #1 by maxim — 2013-01-14T00:10:26Z
Moving struct definition outside function does not result in crash.
Comment #2 by yebblies — 2013-01-14T05:57:12Z
I get:
DMD v2.062 DEBUG
Assertion failure: 'index < dim' on line 318 in file 'root\root.h'
Comment #3 by maxim — 2013-01-14T07:42:16Z
(In reply to comment #2)
> I get:
>
> DMD v2.062 DEBUG
> Assertion failure: 'index < dim' on line 318 in file 'root\root.h'
I updated my dmd to today version, and still receive original message. It happens on linux 64 bit.