http://d.puremagic.com/issues/show_bug.cgi?id=6784



--- Comment #3 from Don <clugd...@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: -------

Reply via email to