mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
28 lines
331 B
D
28 lines
331 B
D
module scope5;
|
|
|
|
int i;
|
|
|
|
void func(int a, int b)
|
|
{
|
|
i = 0;
|
|
{
|
|
scope(exit) i++;
|
|
if (a) {
|
|
scope(exit) i++;
|
|
if (b) return;
|
|
i++;
|
|
}
|
|
}
|
|
i++;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
func(0,0);
|
|
assert(i == 2);
|
|
func(1,1);
|
|
assert(i == 2);
|
|
func(1,0);
|
|
assert(i == 4);
|
|
}
|