http://d.puremagic.com/issues/show_bug.cgi?id=1273 the doc quotes following code to be valid: int foo(int f) { return f * 3; } invariant int z = foo(2) + 1; <- Error: cannot evaluate foo(2) at compile time but the compiler does not