'auto pure' (actually, purity inference) has been integrated in commit 'dfb68'*, Thanks Walter:

------------------------------
int y()(int x) {  // <-- pure is inferred for template function
    return 0;
}
void main() pure {
    y(2);
}
------------------------------



But I think it should be able to detect @safe as well:

------------------------------
int y()(int x) {
    return 0;
}
void main() @safe {
    y(2);
}
------------------------------
y.d(5): Error: safe function 'main' cannot call system function 'y'
------------------------------


*: https://github.com/D-Programming-Language/dmd/commit/dfb68

Reply via email to