mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
* throw is replaced with assert(0) * catch is ignored * better foreach support * various bugfixes
27 lines
223 B
D
27 lines
223 B
D
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;
|
|
}
|