Comment #0 by dlang-bugzilla — 2010-03-13T14:53:46Z
struct S
{
string g() { return ""; }
void f() { mixin(g()); }
}
Making g() static stops DMD from crashing.
Comment #1 by nfxjfg — 2010-03-13T14:58:02Z
There's another problem. This fails to compile:
struct S
{
static string g() { return null; }
void f() { mixin(g()); } //line 4
}
z.d(4): Error: argument to mixin must be a string, not (null)
(Tested with dmd v2.041.)
Comment #2 by clugdbug — 2010-03-15T12:21:05Z
PATCH(against 2.042): This is trivial.
// interpret.c line 2569:
if (pthis && fd)
{ // Member function call
if (pthis->op == TOKthis)
- pthis = istate->localThis;
+ pthis = istate ? istate->localThis : NULL;
else if (pthis->op == TOKcomma)
pthis = pthis->interpret(istate);
The second issue is that mixin(null); is never allowed. It's completely unrelated to this bug. Create a new bug for it if you think it matters.