view tests/mini/bug163_void_condexp.d @ 958:89729c76b8ff

Static ctors/dtors added via template mixins should not be added to modules that just import a module containing such a mixin.
author Christian Kamm <kamm incasoftware de>
date Sun, 15 Feb 2009 14:54:36 +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);
}