[Issue 6784] Compile-time constant assigned with a runtime value
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 22 12:00:00 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=6784
--- Comment #3 from Don <clugdbug at yahoo.com.au> 2012-02-22 11:59:55 PST ---
FWIW, this patch in optimize.c, DotVarExp::optimize() fixes the bug. But, the
exclusion of TOKassocarrayliteral is just a hack.
if (e && e->op == TOKstructliteral)
{ StructLiteralExp *sle = (StructLiteralExp *)e;
VarDeclaration *vf = var->isVarDeclaration();
if (vf)
{
Expression *e = sle->getField(type, vf->offset);
if (e && e != EXP_CANT_INTERPRET)
return e;
}
}
+ else if (result & WANTinterpret && (!e || e->op != TOKassocarrayliteral))
+ error("%s cannot be evaluated at compile time", e1->toChars());
return this;
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list