http://d.puremagic.com/issues/show_bug.cgi?id=4291
Shin Fujishiro <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch --- Comment #1 from Shin Fujishiro <[email protected]> 2010-06-07 02:41:25 PDT --- Patch against DMD r524: ==================== --- src/expression.c +++ src/expression.c @@ -4406,7 +4406,7 @@ Expression *VarExp::semantic(Scope *sc) error("pure function '%s' cannot access mutable static data '%s'", sc->func->toChars(), v->toChars()); } - else if (sc->func->isPure() && sc->parent != v->parent && + else if (sc->func->isPure() && sc->parent->pastMixin() != v->parent->pastMixin() && !v->isImmutable() && !(v->storage_class & STCmanifest)) { ==================== The patched code also deals with function's scope (sc->parent->pastMixin) so that this valid code is accepted: -------------------- void test() pure { mixin declareVariable; mixin declareFunction; readVar(); } template declareVariable() { int var; } template declareFunction() { int readVar() { return var; } } -------------------- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
