On 2/28/13, Timon Gehr <[email protected]> wrote:
> It's really easy. DMD can be convinced to do a sufficient conservative
> analysis even now, but the behaviour is undocumented and seems
> unintentional.
>
>
>      void main() {
>          void foo()() { bar(); }
>          void bar()() { i = 3; }
>          int i;
>          foo();
>      }

You can even make them non-templates if they're part of a mixin template.

mixin template T()
{
    void foo() { bar(); }
    void bar() { i = 3; }
    int i;
}

void main()
{
    mixin T!();
    foo();
}

Reply via email to