view test/nested11.d @ 133:44a95ac7368a trunk

[svn r137] Many fixes towards tango.io.Console working, but not quite there yet... In particular, assertions has been fixed to include file/line info, and much more!
author lindquist
date Mon, 14 Jan 2008 05:11:54 +0100
parents 5825d48b27d1
children 25fa34e899e9
line wrap: on
line source

module nested11;

void main()
{
    int i;

    void f()
    {
        i++;

        void g()
        {
            i++;

            void h()
            {
                printf("i = %d\n", i);
            }

            h();
        }

        g();
    }

    f();
    assert(i == 2);

    void foo()
    {
        i = 42;
    }

    void bar()
    {
        foo();
    }

    bar();
    printf("i = %d\n", i);
    assert(i == 42);
}