https://issues.dlang.org/show_bug.cgi?id=23530
--- Comment #3 from Dlang Bot <[email protected]> --- @ntrel created dlang/dmd pull request #15597 "Add CastExp.toLvalue obsolete warning if implicit pointer conversion would fail" fixing this issue: - Add CastExp.toLvalue -wo warning if implicit pointer conv would fail From https://dlang.org/spec/expression.html#.define-lvalue > The following expressions, and no others, are called lvalue expressions or lvalues ... > cast(U) expressions applied to lvalues of type T when T* is implicitly convertible to U*; > cast() and cast(qualifier list) when applied to an lvalue. The first rule was not enforced by dmd. The second rule contradicts the point of the first rule. It should be updated to work in the same way. Fixes Issue 23530 - casting immutable away allowed in safe. https://github.com/dlang/dmd/pull/15597 --
