view test/throw1.d @ 34:4648206ca213 trunk

[svn r38] * resizing dynamic arrays support * throw is replaced with assert(0) * catch is ignored * better foreach support * various bugfixes
author lindquist
date Tue, 09 Oct 2007 02:50:00 +0200
parents
children 5071469303d4
line wrap: on
line source

module throw1;

extern(C) int rand();

class C
{
}

void func()
{
    if (rand() & 1)
        throw new C;
}

int main()
{
    try
    {
        func();
    }
    catch(Object)
    {
        return 1;
    }
    return 0;
}