mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 19:03:13 +01:00
19 lines
276 B
D
19 lines
276 B
D
|
|
static foocalled = false;
|
|
static barcalled = false;
|
|
void foo() { foocalled = true; }
|
|
void bar() { barcalled = true; }
|
|
|
|
void f(bool b)
|
|
{
|
|
return b ? foo() : bar();
|
|
}
|
|
|
|
void main()
|
|
{
|
|
f(true);
|
|
assert(foocalled && !barcalled);
|
|
f(false);
|
|
assert(foocalled && barcalled);
|
|
}
|