view tests/mini/bug163_void_condexp.d @ 943:95d09451cb59

Reverted the template instantiation changes from rev [940]. Wasn't safe it seems :(
author Tomas Lindquist Olsen <tomas.l.olsen@gmail.com>
date Thu, 05 Feb 2009 18:17:42 +0100
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);
}