view tests/mini/o.d @ 1647:638a823ace45

Strange workaround for returning from within 'void main()'. The new dmdfe sets the ReturnStatement->exp to null. Fixed bug #391.
author Kelly Wilson <wilsonk cpsc.ucalgary.ca>
date Wed, 10 Mar 2010 19:35:14 -0700
parents eaf87e36ce0d
children
line wrap: on
line source

extern(C) int printf(char*, ...);

void func()
{
    try
    {
        printf("try\n");
        return;
    }
    catch
    {
        printf("catch\n");
    }
    finally
    {
        printf("finally\n");
    }
    return;
}

void main()
{
    func();
}