view tests/mini/bug163_void_condexp.d @ 1651:cb960b882ca3 default tip

bindings were moved to dsource.org/projects/bindings/
author Moritz Warning <moritzwarning@web.de>
date Thu, 20 May 2010 20:05:03 +0200
parents 7f6eeb7b003e
children
line wrap: on
line source


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);
}