Test case:
------------------------------
int f6356()(int a) {
return a*a;
}
alias f6356!() g6356; // comment this out to eliminate the errors
pure nothrow @safe int i6356() {
return f6356(1);
}
------------------------------
x.d(6): Error: pure function 'i6356' cannot call impure function 'f6356'
x.d(6): Error: safe function 'i6356' cannot call system function 'f6356'
x.d(6): Error: f6356 is not nothrow
x.d(5): Error: function x.i6356 'i6356' is nothrow yet may throw
------------------------------
Comment #1 by kennytm — 2011-07-20T11:09:12Z
Raising severity because unaryFun and binaryFun are used in template constraints or return types. This bug makes std.algorithm.equal not able to be pure/nothrow/@safe, for example.
2nd test case:
-----------------------------
bool f6356b()() {
return true;
}
void g6356b()() if (is(typeof(f6356b()))) {
f6356b();
}
void h6356b() pure nothrow @safe {
//f6356b(); // <-- uncomment to make it compile.
g6356b();
}
-----------------------------
x.d(9): Error: pure function 'h6356b' cannot call impure function 'g6356b'
x.d(9): Error: safe function 'h6356b' cannot call system function 'g6356b'
x.d(9): Error: g6356b is not nothrow
x.d(7): Error: function x.h6356b 'h6356b' is nothrow yet may throw
-----------------------------