Tried running dmd+phobos head at some code, but got errors.
This is probably the breaking change: https://github.com/D-Programming-Language/phobos/commit/7714a9c42e2cc8d794a5ee483fdd49d52995b3ac
import std.exception;
class E: Exception
{
this(string msg, string file=__FILE__, size_t line=__LINE__) { super(msg, file, line); }
}
void f() pure
{
enforceEx!E(true);
}
void main() {
f();
}
// Error: pure function 't.f' cannot call impure function 'std.exception.enforceEx!(E).enforceEx!bool.enforceEx
Comment #1 by k.hara.pg — 2013-09-22T04:15:34Z
This is expected change in git-head, introduced by fixing bug 10254.
In the OP code, the constructor in E is not annotated with pure. So, the expression object creation new E("msg") is essentially impure. But in 2.063 and earlier, NewExpression had wrongly ignored the called constructor purity and safety (== bug 10254). Then enforceEx!E had been also incorrectly deduced to pure.