Files
ldc/tests/mini/bug308_double_finally.d
2009-05-23 00:26:38 +02:00

20 lines
322 B
D

extern(C) int printf(char*, ...);
long foo(ref int p) {
try { return 0; }
finally {
p++;
throw new Object;
}
}
void main() {
int p = 0;
try {
foo(p);
assert(0);
} catch {
}
printf("Number of types scope(exit) was executed : %d\n", p);
assert(p == 1);
}