The following code fails with dmd.1.006:
bool isWhitespace(char c) {
return true;
}
static if(isWhitespace('c'))
int x;
with the messages
foo.d(4): Error: expression (isWhitespace)('c') is not constant or does not evaluate to a bool
Comment #1 by webmaster — 2007-02-22T22:40:13Z
Looks like this was fixed in 1.007.
Comment #2 by webmaster — 2007-02-23T10:54:28Z
Looks like static assert() now has this problem in dmd.1.007. That is, change static if() in the example code to static assert() and we get the same problem.