Thread:
http://forum.dlang.org/thread/[email protected]#post-khdhvzfdfljbtlyfqocw:40forum.dlang.org
When compiled with -O -inline:
--------
struct S
{
int[0] a;
void do_it()
{
foo(a);
}
}
void foo(Args...)(Args args)
{
//foreach(arg; args)
// if (arg.ptr == null)
// return;
bar(args);
}
void bar(Args...)(Args args)
{
foreach(arg; args)
if (arg.ptr == null)
return;
}
void main()
{}
--------
Produces:
main.d(11): Error: variable _param_0 used before set
--------
Possibly the compiler optimizes out a's initialization, since it is an empty static array.
Code is glitchy: Not only does the bug appear only in bar (and not foo), un-commenting the code in foo will *fix* the call in bar...